diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2022-01-04 11:22:38 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2022-01-04 11:22:38 -0700 |
commit | b175bb42dd8f68579d5e0725b6d73a5d6e2ad2bd (patch) | |
tree | dce732ca9a3f628d8e2d8eed9c473c29d5b078d6 /scripts | |
parent | 35b66310cc54a6e06e060a9b471fbfc43ff0341e (diff) | |
download | dotfiles-b175bb42dd8f68579d5e0725b6d73a5d6e2ad2bd.tar.gz |
sway-ftp-master: deal with windows opening on old workspace
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/desktop/sway-ftp-master | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/scripts/desktop/sway-ftp-master b/scripts/desktop/sway-ftp-master index dd90663c..bb15cfb1 100755 --- a/scripts/desktop/sway-ftp-master +++ b/scripts/desktop/sway-ftp-master @@ -34,8 +34,14 @@ sub marked_exists { sub focus_title { system "swaymsg", qq|[title="$_[0]"]|, "focus" } +sub bring_title { system "swaymsg", qq|[title="$_[0]"]|, + "move to workspace current,", "focus" } + sub focus_marked { system "swaymsg", qq|[con_mark="$_[0]"]|, "focus" } +sub bring_marked { system "swaymsg", qq|[con_mark="$_[0]"]|, + "move to workspace current,", "focus" } + if (marked_exists "dak") { focus_marked "dak"; } else { @@ -54,19 +60,19 @@ if (marked_exists "dak") { "--title=ftp-master dak command session", "ssh-and-tmux", "ftp-master.debian.org", "dak"; sleep 0.3 until marked_exists "dak"; - focus_marked "dak"; + bring_marked "dak"; fork // die "couldn't fork" or exec "foot", "--override=locked-title=yes", "--title=ftp-master GNU mc session", "ssh-and-tmux", "ftp-master.debian.org", "mc"; sleep 0.3 until marked_exists "mc"; - focus_marked "mc"; + bring_marked "mc"; system "emacsclient", "-c", "-a", "", "-n", "-e", '(progn (switch-to-buffer "*NEW notes*") (text-mode))'; sleep 0.3 until title_exists "*NEW notes*"; - focus_title "\\*NEW notes\\*"; + bring_title "\\*NEW notes\\*"; # currently we implement only the layout the X11 script chose for melete |