summaryrefslogtreecommitdiff
path: root/dot-local-bin
diff options
context:
space:
mode:
authorMathias Magnusson <mathias@magnusson.space>2025-06-29 22:28:05 +0200
committerMathias Magnusson <mathias@magnusson.space>2025-06-29 22:47:23 +0200
commita0b32034f7c557bcaa38e3610c8a97eeee7a00a8 (patch)
tree3f4f1b7252958ccd8fa3158a35aeb34cdacf94c1 /dot-local-bin
downloadsleipner-a0b32034f7c557bcaa38e3610c8a97eeee7a00a8.tar.gz
Initial commit
Diffstat (limited to 'dot-local-bin')
-rwxr-xr-xdot-local-bin/brightness7
-rwxr-xr-xdot-local-bin/dark-light-switch7
-rwxr-xr-xdot-local-bin/wp-vol8
3 files changed, 22 insertions, 0 deletions
diff --git a/dot-local-bin/brightness b/dot-local-bin/brightness
new file mode 100755
index 0000000..ab365a9
--- /dev/null
+++ b/dot-local-bin/brightness
@@ -0,0 +1,7 @@
+#!/usr/bin/env fish
+
+brightnessctl set $argv[1]
+
+set curr (math -s0 -mround (brightnessctl get) / (brightnessctl max) "*" 100)
+
+notify-send -t 1000 -a 'brightness' -h int:value:$curr " $curr"
diff --git a/dot-local-bin/dark-light-switch b/dot-local-bin/dark-light-switch
new file mode 100755
index 0000000..488b71a
--- /dev/null
+++ b/dot-local-bin/dark-light-switch
@@ -0,0 +1,7 @@
+#!/usr/bin/env fish
+
+if [ (gsettings get org.gnome.desktop.interface color-scheme) = "'prefer-dark'" ]
+ gsettings set org.gnome.desktop.interface color-scheme prefer-light
+else
+ gsettings set org.gnome.desktop.interface color-scheme prefer-dark
+end
diff --git a/dot-local-bin/wp-vol b/dot-local-bin/wp-vol
new file mode 100755
index 0000000..4ae235c
--- /dev/null
+++ b/dot-local-bin/wp-vol
@@ -0,0 +1,8 @@
+#!/usr/bin/env fish
+
+wpctl set-volume @DEFAULT_AUDIO_SINK@ $argv[1]
+
+# Get the volume level and convert it to a percentage
+set volume (math -s0 -mround (wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{print $2}') "*" 100)
+
+notify-send -t 1000 -a 'wp-vol' -h int:value:$volume " $volume"