diff options
| author | Natasha Moongrave <natasha@256phi.eu> | 2026-03-31 12:31:00 +0200 |
|---|---|---|
| committer | Natasha Moongrave <natasha@256phi.eu> | 2026-03-31 12:31:00 +0200 |
| commit | 59be3fbd673d64c12a1a831081b40f4ae888c939 (patch) | |
| tree | a1b0ab9df313bf6282d50a7ffc19ae3db517dc26 /home/rices/original/scripts.nix | |
| parent | d8b557099f4d4938f7f87c236f22d416191fcde9 (diff) | |
Moved the original i3 config to /home/rices/original to be in line with the other refactored configs
Diffstat (limited to 'home/rices/original/scripts.nix')
| -rw-r--r-- | home/rices/original/scripts.nix | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/home/rices/original/scripts.nix b/home/rices/original/scripts.nix new file mode 100644 index 0000000..5bf8c6b --- /dev/null +++ b/home/rices/original/scripts.nix @@ -0,0 +1,31 @@ +{ pkgs, ... }: + +{ + home.packages = [ + (pkgs.writeShellScriptBin "get-spotify-status" '' + PARENT_BAR="example" + PLAYER="playerctld" + FORMAT="{{ title }} - {{ artist }}" + + PLAYERCTL_STATUS=$(playerctl --player=$PLAYER status 2>/dev/null) + + if [ "$PLAYERCTL_STATUS" = "Playing" ]; then + playerctl --player=$PLAYER metadata --format "$FORMAT" + elif [ "$PLAYERCTL_STATUS" = "Paused" ]; then + echo "Paused" + else + echo "No music" + fi + '') + + (pkgs.writeShellScriptBin "polybar-hide-on-fullscreen" '' + i3-msg -t subscribe -m '[ "window" ]' | while read -r event; do + if echo "$event" | grep -q '"fullscreen_mode":[[:space:]]*1'; then + polybar-msg cmd hide + elif echo "$event" | grep -q '"fullscreen_mode":[[:space:]]*0'; then + polybar-msg cmd show + fi + done + '') + ]; +} |
