mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
Enable kdeconnect-indicator; only show spotify info if spotify is running
This commit is contained in:
@@ -141,7 +141,10 @@ in {
|
||||
};
|
||||
};
|
||||
|
||||
services.kdeconnect.enable = true;
|
||||
services.kdeconnect = {
|
||||
enable = true;
|
||||
indicator = true;
|
||||
};
|
||||
|
||||
services.dunst = with import ./theme.nix; {
|
||||
enable = true;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{ pkgs, lib, config, ... }:
|
||||
let
|
||||
spotify_info = pkgs.writeBash "spotify.info" ''
|
||||
if $(pgrep spotify); then
|
||||
STATUS=$(${pkgs.dbus}/bin/dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'PlaybackStatus'|egrep -A 1 "string"|cut -b 26-|cut -d '"' -f 1|egrep -v ^$)
|
||||
|
||||
if [[ "$STATUS" == 'Playing' ]]; then
|
||||
@@ -23,6 +24,7 @@ let
|
||||
TITLE=$(echo "$METADATA" | egrep -A 1 "title" | egrep -v "title" | cut -b 44- | cut -d '"' -f 1 | egrep -v ^$)
|
||||
|
||||
printf "%s \u2237 %s" "$ARTIST" "$TITLE"
|
||||
fi
|
||||
'';
|
||||
battery_info = pkgs.writeBash "battery.info" ''
|
||||
BAT_DIR="/sys/class/power_supply/$BLOCK_INSTANCE/"
|
||||
|
||||
Reference in New Issue
Block a user