aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/get-focussed-monitor
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2022-12-24 23:41:46 +0100
committerPatrick Spek <p.spek@tyil.nl>2022-12-24 23:50:07 +0100
commitbbe259c88e8c3c2a7e70f703891c59ffa78da8c4 (patch)
treee18eaf1e2649d5e34e910a5b43d58fcc7579ef43 /.local/bin/get-focussed-monitor
parent9ea5ffce343ff56472167cce72454e40c7937965 (diff)
Clean up some old utils
Diffstat (limited to '.local/bin/get-focussed-monitor')
-rwxr-xr-x.local/bin/get-focussed-monitor43
1 files changed, 0 insertions, 43 deletions
diff --git a/.local/bin/get-focussed-monitor b/.local/bin/get-focussed-monitor
deleted file mode 100755
index 4d7bbd4..0000000
--- a/.local/bin/get-focussed-monitor
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/env raku
-
-use v6.d;
-
-sub MAIN (
- #Bool:D :$shell = False,
- Bool:D :$coords = False,
-) {
- my @xrandr = shell('xrandr | grep -w connected', :out).out.slurp.lines;
- my %monitors;
-
- my $mouse = shell('xdotool getmouselocation', :out).out.slurp.trim ~~ m/
- 'x:' $<x> = [ \d+ ]
- \s*
- 'y:' $<y> = [ \d+ ]
- /;
-
- for @xrandr -> $monitor {
- my $match = $monitor ~~ m/
- $<width> = [ \d+ ]
- 'x'
- $<height> = [ \d+ ]
- '+'
- $<x> = [ \d+ ]
- '+'
- $<y> = [ \d+ ]
- /;
-
- next unless $match<x> ≤ $mouse<x> ≤ ($match<x> + $match<width>);
- next unless $match<y> ≤ $mouse<y> ≤ ($match<y> + $match<height>);
-
- say qq[MONITOR="{$monitor.words.first}"];
-
- if ($coords) {
- say qq[W="{$match<width>}"];
- say qq[H="{$match<height>}"];
- say qq[X="{$match<x>}"];
- say qq[Y="{$match<y>}"];
- }
-
- last;
- }
-}