summaryrefslogtreecommitdiff
path: root/config/X/xmobar/scripts/whscreen
diff options
context:
space:
mode:
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 '>'