diff options
| author | Natasha Moongrave <natasha@256phi.eu> | 2026-02-02 10:37:04 +0100 |
|---|---|---|
| committer | Natasha Moongrave <natasha@256phi.eu> | 2026-02-02 10:37:04 +0100 |
| commit | 5f8f587c5edaf1f2ffb456f55477bd1b2ce2d444 (patch) | |
| tree | fef11c65fa674ea97c0a5b8762a32840a69eff49 /modules/home/i3wm/scripts.nix | |
| parent | 39e1bbc2c3ec704135d93dda58346c640c2ad8d6 (diff) | |
moved things, removed useless nixos modules, switched to hyprland
Diffstat (limited to 'modules/home/i3wm/scripts.nix')
| -rw-r--r-- | modules/home/i3wm/scripts.nix | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/modules/home/i3wm/scripts.nix b/modules/home/i3wm/scripts.nix new file mode 100644 index 0000000..4eb0b61 --- /dev/null +++ b/modules/home/i3wm/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 + '') + ]; +}
\ No newline at end of file |
