From 5076f9c5addea44268051a82de5f5592fcb17cd0 Mon Sep 17 00:00:00 2001 From: Arti Zirk Date: Thu, 16 Apr 2020 14:52:50 +0300 Subject: [PATCH] Switch to tvolnoti --- .bin/fakebluezplayer.py | 8 ++++++++ .config/sway/config | 12 +++++++++--- .config/tvolnoti/themes | 1 + 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100755 .bin/fakebluezplayer.py create mode 120000 .config/tvolnoti/themes diff --git a/.bin/fakebluezplayer.py b/.bin/fakebluezplayer.py new file mode 100755 index 0000000..af491d4 --- /dev/null +++ b/.bin/fakebluezplayer.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python3 +import dbus, time +bus = dbus.SystemBus() +media = dbus.Interface(bus.get_object("org.bluez", "/org/bluez/hci0"), 'org.bluez.Media1') +path = dbus.ObjectPath('/dummy_player') +media.RegisterPlayer(path, {}) +while True: time.sleep(10000) + diff --git a/.config/sway/config b/.config/sway/config index 4f7732f..5724c72 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -21,7 +21,7 @@ font pango:Terminus 12 set $bg "~/Pildid/background.png" # Lock screen -set $lockcmd ~/.bin/swaylock.sh +set $lockcmd ~/.bin/swaylock.sh $bg # Your preferred terminal emulator set $term gnome-terminal @@ -50,8 +50,14 @@ exec xrdb -load ~/.Xresources # Notification daemon exec mako --default-timeout 10000 -# Simple bar -exec rm /tmp/wobpipe; mkfifo /tmp/wobpipe && tail -f /tmp/wobpipe | wob +# Volume and Brightness notification +exec tvolnoti -n -T dark + +# Monitor volume changes +exec pactl subscribe | grep --line-buffered "sink" | xargs -n1 sh -c 'tvolnoti-show $(amixer get Master | grep -Po "[0-9]+(?=%)" | tail -1)' + +# Register a fake player in bluez so that volume control would work +exec ~/.bin/fakebluezplayer.py # Polkit agent exec ~/.bin/polkit-agent diff --git a/.config/tvolnoti/themes b/.config/tvolnoti/themes new file mode 120000 index 0000000..4d8f0d7 --- /dev/null +++ b/.config/tvolnoti/themes @@ -0,0 +1 @@ +/usr/share/tvolnoti/themes \ No newline at end of file