summaryrefslogtreecommitdiff
path: root/config/X/xmobar/scripts/whscreen
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2023-02-15 16:31:56 +0100
committerRaymaekers Luca <raymaekers.luca@gmail.com>2023-02-15 16:47:43 +0100
commit3b2a78935fd6550521f719a10e5b0fceb1ddb350 (patch)
tree7c50801d6bb5b7abba3df6352ed43df454a4dbcb /config/X/xmobar/scripts/whscreen
Not really but, First commit!
Diffstat (limited to 'config/X/xmobar/scripts/whscreen')
-rwxr-xr-xconfig/X/xmobar/scripts/whscreen23
1 files changed, 23 insertions, 0 deletions
diff --git a/config/X/xmobar/scripts/whscreen b/config/X/xmobar/scripts/whscreen
new file mode 100755
index 0000000..030493b
--- /dev/null
+++ b/config/X/xmobar/scripts/whscreen
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+# # -- Based on mouse
+# # Get mouse location, only X matters
+# X=$(\
+# xdotool getmouselocation -s \
+# | head -n1 \
+# | cut -f2 -d'='\
+# )
+
+# Based on active window
+X=$(xdotool getwindowgeometry -s $(xdotool getwindowfocus) | grep "X" | cut -d'=' -f2)
+
+# For dual monitor setup
+monitor_width="$(\
+ xdotool getdisplaygeometry \
+ | cut -d ' ' -f 1 \
+)"
+
+# If '-' number is negative
+[[ "$((${X} - ${monitor_width}))" -lt 0 ]] \
+ && echo -n '<' \
+ || echo -n '>'