summaryrefslogtreecommitdiff
path: root/bin/displayctl
diff options
context:
space:
mode:
authorpants <niklasjo2004@gmail.com>2026-09-21 14:17:03 -0700
committerpants <niklasjo2004@gmail.com>2026-09-21 14:17:03 -0700
commit7b21727285e50b0b050c4ddd70d07542229c5366 (patch)
tree5d369153c5df5b41f3750d25479a68f20169c8ff /bin/displayctl
init
Diffstat (limited to 'bin/displayctl')
-rwxr-xr-xbin/displayctl36
1 files changed, 36 insertions, 0 deletions
diff --git a/bin/displayctl b/bin/displayctl
new file mode 100755
index 0000000..85c6c7b
--- /dev/null
+++ b/bin/displayctl
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+# unused for now, repurposing for ddcutil control
+## back in use!
+
+CHOICE=$(printf "brightness\ncontrast\ntoggle secondary display" | dmenu -c -i -l 3)
+DISPLAY_STATUS=$(xrandr | grep DisplayPort-0)
+MONITORS="1 2"
+
+toggle() {
+ case $DISPLAY_STATUS in
+ *3440x1440*)
+ xrandr --output DisplayPort-0 --off;;
+ *)
+ init_displays;;
+ esac
+}
+
+get_value() {
+ VALUE=$(printf "0\n10\n20\n30\n40\n50\n60\n70\n80\n90\n100" | dmenu -c -i -p "value to set")
+}
+
+case $CHOICE in
+ "brightness")
+ get_value
+ for monitor in $MONITORS; do
+ ddcutil -d $monitor setvcp 10 $VALUE
+ done;;
+ "contrast")
+ get_value
+ for monitor in $MONITORS; do
+ ddcutil -d $monitor setvcp 12 $VALUE
+ done;;
+ "toggle secondary display")
+ toggle;;
+esac