summaryrefslogtreecommitdiff
path: root/main.fish
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-04-03 21:41:26 +1100
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-04-03 21:41:26 +1100
commitf8a6e84aa9b9229a1b527dcd1c662c1068759dd8 (patch)
tree0893be4c5101a49dfbea6af52ad865d5e3f91481 /main.fish
parentcompletions: add for shell toggle cmd (diff)
downloadcaelestia-cli-f8a6e84aa9b9229a1b527dcd1c662c1068759dd8.tar.gz
caelestia-cli-f8a6e84aa9b9229a1b527dcd1c662c1068759dd8.tar.bz2
caelestia-cli-f8a6e84aa9b9229a1b527dcd1c662c1068759dd8.zip
toggles: refactor to have config
Config is in $XDG_CONFIG_HOME/caelestia/scripts.json Selector is a jq selector using hyprland client data Spawn is a command passed to uwsm app Action is either spawn, move, or both Extra cond is an extra shell command to check whether to do action (for easy disabling just put false or empty action)
Diffstat (limited to 'main.fish')
-rwxr-xr-xmain.fish12
1 files changed, 11 insertions, 1 deletions
diff --git a/main.fish b/main.fish
index c787258..0780977 100755
--- a/main.fish
+++ b/main.fish
@@ -20,7 +20,17 @@ end
if test "$argv[1]" = toggle
set -l valid_toggles communication music sysmon specialws todo
- contains -- "$argv[2]" $valid_toggles && $src/toggles/$argv[2].fish || error "Invalid toggle: $argv[2]"
+ if contains -- "$argv[2]" $valid_toggles
+ if $argv[2] = specialws
+ $src/toggles/specialws.fish
+ else
+ . $src/toggles/util.fish
+ toggle-workspace $argv[2]
+ end
+ else
+ error "Invalid toggle: $argv[2]"
+ end
+
exit
end