Skip to content

Commit

Permalink
Merge pull request #1188 from Ulauncher/refactor/gio.notification
Browse files Browse the repository at this point in the history
refactor: move from libnotify to gio.notification
  • Loading branch information
friday committed Jan 21, 2023
2 parents d46430c + 1d58782 commit 47e72fc
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
run: |
echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections
sudo apt update &&
sudo apt install -y -q xvfb libgirepository1.0-dev libcairo2-dev gir1.2-glib-2.0 gir1.2-gtk-3.0 gir1.2-keybinder-3.0 gir1.2-notify-0.7 gir1.2-webkit2-4.0 gir1.2-wnck-3.0
sudo apt install -y -q xvfb libgirepository1.0-dev libcairo2-dev gir1.2-glib-2.0 gir1.2-gtk-3.0 gir1.2-keybinder-3.0 gir1.2-webkit2-4.0 gir1.2-wnck-3.0
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ For the v6 branch you need the the following to setup the local build environmen

```sh
sudo apt-get install python3-{all,gi,levenshtein} gobject-introspection \
gir1.2-{glib-2.0,gtk-3.0,notify-0.7,webkit2-4.0,wnck-3.0,keybinder-3.0}
gir1.2-{glib-2.0,gtk-3.0,webkit2-4.0,wnck-3.0,keybinder-3.0}
```

</details>
Expand All @@ -65,7 +65,7 @@ For the v6 branch you need the the following to setup the local build environmen

```sh
sudo pacman -Syu --needed \
gtk3 webkit2gtk-4.1 libnotify libkeybinder3 libwnck3 python-{cairo,gobject,levenshtein}
gtk3 webkit2gtk-4.1 libkeybinder3 libwnck3 python-{cairo,gobject,levenshtein}
```
</details>

Expand Down
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ RUN apt install -y python3-gi-cairo
RUN apt install -y gir1.2-glib-2.0
RUN apt install -y gir1.2-gtk-3.0
RUN apt install -y gir1.2-wnck-3.0
RUN apt install -y gir1.2-notify-0.7
RUN apt install -y gir1.2-webkit2-4.0
RUN apt install -y gir1.2-keybinder-3.0

Expand Down
1 change: 0 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Depends: ${misc:Depends},
gir1.2-webkit2-4.0,
gir1.2-wnck-3.0,
gir1.2-glib-2.0,
gir1.2-notify-0.7,
gir1.2-gdkpixbuf-2.0,
python3-gi,
python3-gi-cairo,
Expand Down
3 changes: 0 additions & 3 deletions docs/extensions/libs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,5 @@ In future we'll make it possible to support ``requirements.txt`` for extensions.
`gir1.2-glib-2.0 <https://lazka.github.io/pgi-docs/#GLib-2.0>`_
Low level core library

`gir1.2-notify-0.7 <https://lazka.github.io/pgi-docs/#Notify-0.7>`_
Desktop notification library (libnotify is a library for sending desktop notifications)

`gir1.2-gdkpixbuf-2.0 <https://lazka.github.io/pgi-docs/#GdkPixbuf-2.0>`_
An image loading library
21 changes: 0 additions & 21 deletions docs/source/ulauncher.utils.desktop.rst

This file was deleted.

1 change: 1 addition & 0 deletions io.ulauncher.Ulauncher.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ Icon=ulauncher
SingleMainWindow=true
Terminal=false
Type=Application
X-GNOME-UsesNotifications=true
8 changes: 6 additions & 2 deletions ulauncher/ui/UlauncherApp.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from ulauncher.config import FIRST_RUN
from ulauncher.utils.environment import IS_X11
from ulauncher.utils.Settings import Settings
from ulauncher.utils.desktop.notification import show_notification
from ulauncher.ui.AppIndicator import AppIndicator
from ulauncher.ui.windows.PreferencesWindow import PreferencesWindow
from ulauncher.ui.windows.UlauncherWindow import UlauncherWindow
Expand Down Expand Up @@ -112,7 +111,7 @@ def bind_hotkey(self, accel_name):
self._current_accel_name = accel_name
if FIRST_RUN:
display_name = Gtk.accelerator_get_label(*Gtk.accelerator_parse(accel_name))
show_notification("Ulauncher", f"Hotkey is set to {display_name}")
self.show_notification(f"Hotkey is set to {display_name}", "hotkey_first_run")

def show_preferences(self, page=None):
self.window.hide()
Expand All @@ -122,3 +121,8 @@ def show_preferences(self, page=None):
else:
self.preferences = PreferencesWindow(application=self)
self.preferences.show(page)

def show_notification(self, text, id=None):
notification = Gio.Notification.new("Ulauncher")
notification.set_body(text)
self.send_notification(id, notification)
Empty file.
23 changes: 0 additions & 23 deletions ulauncher/utils/desktop/notification.py

This file was deleted.

0 comments on commit 47e72fc

Please sign in to comment.