From d5eec819604ec8f86153e4bffc743f9b40d1f647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Sun, 20 Dec 2020 20:53:55 +0100 Subject: [PATCH] py3status: Add icons for redshift & spotify --- i3/i3status.conf.j2 | 16 ++++++++++++++++ i3/scripts/toggle-app | 17 +++++++++++++++++ packages.yml | 2 +- 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100755 i3/scripts/toggle-app diff --git a/i3/i3status.conf.j2 b/i3/i3status.conf.j2 index fbec720..2f6a68b 100644 --- a/i3/i3status.conf.j2 +++ b/i3/i3status.conf.j2 @@ -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 ] ]' } diff --git a/i3/scripts/toggle-app b/i3/scripts/toggle-app new file mode 100755 index 0000000..1b10a9f --- /dev/null +++ b/i3/scripts/toggle-app @@ -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" diff --git a/packages.yml b/packages.yml index 555c6e2..dcdac96 100644 --- a/packages.yml +++ b/packages.yml @@ -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"]