py3status: Add icons for redshift & spotify

This commit is contained in:
2020-12-20 20:53:55 +01:00
parent ba9654edc3
commit d5eec81960
3 changed files with 34 additions and 1 deletions

View File

@@ -25,6 +25,8 @@ order += "volume_status input"
order += spotify
order += "wifi"
order += "external_script presentation_mode"
order += "systemd redshift"
order += "systemd spotify"
order += online_status
order += "battery_level all"
order += "clock"
@@ -42,6 +44,20 @@ battery_level all {
threshold_full = 95
}
systemd redshift {
unit = "redshift.service"
user = true
format = "  "
on_click 1 = "exec $HOME/.i3/scripts/toggle-app redshift"
}
systemd spotify {
unit = "spotify.service"
user = true
format = "  "
on_click 1 = "exec $HOME/.i3/scripts/toggle-app spotify"
}
yubikey {
format = '[  YubiKey[\?if=is_gpg ][\?if=is_u2f ] ]'
}

17
i3/scripts/toggle-app Executable file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/env bash
app="${1:?app missing}"
unitname="${app}.service"
running() {
systemctl --user --quiet status "${unitname}" >/dev/null
}
if running ; then
systemctl --user stop "${unitname}"
else
systemctl --user start "${unitname}"
fi
py3-cmd refresh "systemd $app"

View File

@@ -164,7 +164,7 @@ packages:
py3status:
fedora: ["py3status", "python3-pytz", "python3-tzlocal"]
ubuntu: ["py3status", "python3-arrow", "python3-tzlocal"]
archlinux: ["py3status", "python-pytz", "python-tzlocal", "python-dbus"]
archlinux: ["py3status", "python-pytz", "python-tzlocal", "python-dbus", "python-pydbus"]
pass:
fedora: ["pass"]
ubuntu: ["pass"]