summaryrefslogtreecommitdiff
path: root/modules/home/i3wm/original/scripts.nix
diff options
context:
space:
mode:
authorNatasha Moongrave <natasha@256phi.eu>2026-02-01 23:24:25 +0100
committerNatasha Moongrave <natasha@256phi.eu>2026-02-01 23:24:25 +0100
commit6b31a53666059962b5ccc607e7891b65f0da8138 (patch)
tree982c8f6768ebf6bd44c68430a6748f335b00dd14 /modules/home/i3wm/original/scripts.nix
parent49423b9a43e26d437124faff73470d30e8830be6 (diff)
moved stuff
Diffstat (limited to 'modules/home/i3wm/original/scripts.nix')
-rw-r--r--modules/home/i3wm/original/scripts.nix35
1 files changed, 35 insertions, 0 deletions
diff --git a/modules/home/i3wm/original/scripts.nix b/modules/home/i3wm/original/scripts.nix
new file mode 100644
index 0000000..31d2378
--- /dev/null
+++ b/modules/home/i3wm/original/scripts.nix
@@ -0,0 +1,35 @@
+{ pkgs, ... }:
+
+{
+ { 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