diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2022-08-14 16:00:07 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2022-08-17 10:52:29 -0700 |
commit | e20a00bebf2bb0fa1d19edd674d34395d6dcbd24 (patch) | |
tree | 2473e0155ac3605d837c135b0e8014506648ad8f /scripts | |
parent | f4022a3b8b687122fde40742d7985e4c1ff944c7 (diff) | |
download | dotfiles-e20a00bebf2bb0fa1d19edd674d34395d6dcbd24.tar.gz |
export $wmipc, factor out & export &wmipc
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/desktop/i3status-wrapper | 9 | ||||
-rwxr-xr-x | scripts/desktop/sway-ftp-master | 42 |
2 files changed, 26 insertions, 25 deletions
diff --git a/scripts/desktop/i3status-wrapper b/scripts/desktop/i3status-wrapper index cbe02685..e9df86c8 100755 --- a/scripts/desktop/i3status-wrapper +++ b/scripts/desktop/i3status-wrapper @@ -6,8 +6,10 @@ use 5.032; use strict; use warnings; -use JSON; +use lib "$ENV{HOME}/src/dotfiles/perl5"; +use JSON; +use Local::Desktop; use IO::Pipe; use Sys::Hostname; @@ -33,9 +35,6 @@ my $caffeinated; my $username = $ENV{LOGNAME} || $ENV{USER} || getpwuid($<); my $hostname = hostname; -`which i3-msg`; -my $exec = $? == 0 ? "i3-msg" : "swaymsg"; - expensive(); $SIG{USR1} = sub { kill USR1 => $i3status; expensive() }; @@ -55,7 +54,7 @@ while (my ($statusline) = (<$pipe> =~ /^,?(.*)/)) { sub expensive { my %marks; - walk_tree(\%marks, decode_json `$exec -t get_tree`); + walk_tree(\%marks, decode_json `$wmipc -t get_tree`); $caffeinated = exists $marks{caffeinated} ? $marks{caffeinated} : undef; } diff --git a/scripts/desktop/sway-ftp-master b/scripts/desktop/sway-ftp-master index 3e6fa5e4..11b954b4 100755 --- a/scripts/desktop/sway-ftp-master +++ b/scripts/desktop/sway-ftp-master @@ -32,15 +32,17 @@ sub marked_exists { decode_json `swaymsg -t get_tree`; } -sub focus_title { system "swaymsg", qq|[title="$_[0]"]|, "focus" } +sub focus_title { wmipc qq|[title="$_[0]"] focus| } -sub bring_title { system "swaymsg", qq|[title="$_[0]"]|, - "move to workspace current,", "focus" } +sub bring_title { + wmipc qq|[title="$_[0]"] move to workspace current|, "focus" +} -sub focus_marked { system "swaymsg", qq|[con_mark="$_[0]"]|, "focus" } +sub focus_marked { wmipc qq|[con_mark="$_[0]"] focus| } -sub bring_marked { system "swaymsg", qq|[con_mark="$_[0]"]|, - "move to workspace current,", "focus" } +sub bring_marked { + wmipc qq|[con_mark="$_[0]"] move to workspace current|, "focus" +} if (marked_exists "dak") { focus_marked "dak"; @@ -76,19 +78,19 @@ if (marked_exists "dak") { # currently we implement only the layout the X11 script chose for melete - system "swaymsg", - "move down,", - "focus up,", - "focus left,", - "move right,", - "move right,", - "move right,", - "split v,", - "layout tabbed,", - "resize set width 38,", - "focus left,", - "split v,", - "layout tabbed,", - "resize set height 65,", + wmipc + "move down", + "focus up", + "focus left", + "move right", + "move right", + "move right", + "split v", + "layout tabbed", + "resize set width 38", + "focus left", + "split v", + "layout tabbed", + "resize set height 65", "focus right"; } |