|
@@ -1,11 +1,26 @@ |
|
|
#!/usr/bin/fish |
|
|
#!/usr/bin/fish |
|
|
|
|
|
|
|
|
|
|
|
# get workspace |
|
|
if count $argv |
|
|
if count $argv |
|
|
set ws $argv[1] |
|
|
set ws $argv[1] |
|
|
else |
|
|
else |
|
|
set ws (i3-msg -t get_workspaces | jq --raw-output '.[]|select(.focused == true).name') | grep -oP '([0-9]*:)?\K(.*)' |
|
|
set ws (i3-msg -t get_workspaces | jq --raw-output '.[]|select(.focused == true).name') | grep -oP '([0-9]*:)?\K(.*)' |
|
|
end |
|
|
end |
|
|
|
|
|
set ws_regex (string escape --style=regex $ws) |
|
|
|
|
|
|
|
|
|
|
|
# set todo line |
|
|
|
|
|
set todo_file ~/todo.txt |
|
|
|
|
|
if test -e $todo_file |
|
|
|
|
|
set todo_i3block_sock ~/.todo/i3block.sock |
|
|
|
|
|
grep -v '^x ' $todo_file | grep -P " @ws:$ws_regex(\s|\$)" | head -n 1 | string trim | read todo |
|
|
|
|
|
if test -z $todo |
|
|
|
|
|
echo - | socat STDIN UNIX-CONNECT:$todo_i3block_sock |
|
|
|
|
|
else |
|
|
|
|
|
echo $todo | sed -e 's/ @ws:[^\s].*//g' -e 's/ uuid:[0-9a-f\-]*//g' | socat STDIN UNIX-CONNECT:$todo_i3block_sock |
|
|
|
|
|
end |
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
# focus script |
|
|
set focus_script ~/.workspaces/$ws/focus |
|
|
set focus_script ~/.workspaces/$ws/focus |
|
|
if type -q $focus_script |
|
|
if type -q $focus_script |
|
|
$focus_script |
|
|
$focus_script |
|
@@ -13,6 +28,7 @@ else |
|
|
i3-msg mode default |
|
|
i3-msg mode default |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
# space script |
|
|
set space_script ~/.workspaces/$ws/space |
|
|
set space_script ~/.workspaces/$ws/space |
|
|
if type -q $space_script |
|
|
if type -q $space_script |
|
|
systemctl --user start workspace-app@$ws.service |
|
|
systemctl --user start workspace-app@$ws.service |
|
|