diff --git a/files/bin/on-focus-workspace b/files/bin/on-focus-workspace index 2cabc46..4014844 100644 --- a/files/bin/on-focus-workspace +++ b/files/bin/on-focus-workspace @@ -5,10 +5,15 @@ if count $argv else set ws (i3-msg -t get_workspaces | jq --raw-output '.[]|select(.focused == true).name') end -set script ~/.workspaces/$ws.focus -if type -q $script - $script +set focus_script ~/.workspaces/$ws.focus +if type -q $focus_script + $focus_script else i3-msg mode default end + +set space_script ~/.workspaces/$ws.space +if type -q $space_script + systemctl --user start workspace-app@$ws.service +end diff --git a/files/bin/on-space-shortcut b/files/bin/on-space-shortcut index f1c8291..aa5600f 100644 --- a/files/bin/on-space-shortcut +++ b/files/bin/on-space-shortcut @@ -1,8 +1,8 @@ #!/usr/bin/fish set ws (i3-msg -t get_workspaces | jq --raw-output '.[]|select(.focused == true).name') -set script ~/.workspaces/$ws.space -if type -q $script +set space_script ~/.workspaces/$ws.space +if type -q $space_script systemctl --user restart workspace-app@$ws.service end diff --git a/templates/i3/i3.config.j2 b/templates/i3/i3.config.j2 index 2745f0d..1aaf6d6 100644 --- a/templates/i3/i3.config.j2 +++ b/templates/i3/i3.config.j2 @@ -203,7 +203,7 @@ mode "session" { bindsym r reload; exec --no-startup-id ~/.xsession.reload.fish; mode "default"; {{on_focus_workspace}} bindsym R reload; exec --no-startup-id ~/.xsession.reload.fish; mode "default"; {{on_focus_workspace}} bindsym s exec --no-startup-id {{system_suspend_command}}; mode "default"; {{on_focus_workspace}} - bindsym x exec --no-startup-id {{session_lock_command}}; mode "default"; {{on_focus_workspace}} + bindcode 49 exec --no-startup-id {{session_lock_command}}; mode "default"; {{on_focus_workspace}} bindsym e exec --no-startup-id {{session_enable_screensaver_command}}; mode "default"; {{on_focus_workspace}} bindsym d exec --no-startup-id {{session_disable_screensaver_command}}; mode "default"; {{on_focus_workspace}} bindsym b exec --no-startup-id xsetroot -solid black; mode "default"; {{on_focus_workspace}}