From 3b2a78935fd6550521f719a10e5b0fceb1ddb350 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 15 Feb 2023 16:31:56 +0100 Subject: Not really but, First commit! --- config/X/xmobar/scripts/whscreen | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 config/X/xmobar/scripts/whscreen (limited to 'config/X/xmobar/scripts/whscreen') 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 '>' -- cgit v1.2.3