summaryrefslogtreecommitdiff
path: root/main.fish
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-01-28 16:45:16 +1100
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-01-28 16:45:16 +1100
commit587e29efe4584c8fa8016901302fd4214f78be66 (patch)
tree734816a3e818112cb706363478e6d3a6be7c1822 /main.fish
parenttoggles: update communication (diff)
downloadcaelestia-cli-587e29efe4584c8fa8016901302fd4214f78be66.tar.gz
caelestia-cli-587e29efe4584c8fa8016901302fd4214f78be66.tar.bz2
caelestia-cli-587e29efe4584c8fa8016901302fd4214f78be66.zip
install scripts for all modules
Diffstat (limited to 'main.fish')
-rwxr-xr-xmain.fish21
1 files changed, 14 insertions, 7 deletions
diff --git a/main.fish b/main.fish
index 1f054c0..26e24f1 100755
--- a/main.fish
+++ b/main.fish
@@ -7,10 +7,10 @@ set -l src (dirname (realpath (status filename)))
if test "$argv[1]" = shell
# Start shell if no args
if test -z "$argv[2..]"
- set -q CAELESTIA_SHELL_DIR && set shell_dir $CAELESTIA_SHELL_DIR || set shell_dir $CONFIG/shell
+ set -q CAELESTIA_SHELL_DIR && set -l shell_dir $CAELESTIA_SHELL_DIR || set -l shell_dir $CONFIG/shell
$shell_dir/run.fish
else
- if contains 'caelestia' (astal -l)
+ if contains -- 'caelestia' (astal -l)
log "Sent command '$argv[2..]' to shell"
astal -i caelestia $argv[2..]
else
@@ -22,7 +22,7 @@ end
if test "$argv[1]" = toggle
set -l valid_toggles communication music sysmon specialws
- contains "$argv[2]" $valid_toggles && $src/toggles/$argv[2].fish || error "Invalid toggle: $argv[2]"
+ contains -- "$argv[2]" $valid_toggles && $src/toggles/$argv[2].fish || error "Invalid toggle: $argv[2]"
exit
end
@@ -33,16 +33,22 @@ end
if test "$argv[1]" = scheme
set -l valid_schemes dynamic mocha macchiato frappe latte
- if contains "$argv[2]" $valid_schemes
+ if contains -- "$argv[2]" $valid_schemes
echo -n $argv[2] > $CACHE/scheme/current.txt || error "Invalid scheme: $argv[2]"
test -f $CONFIG/gtk/update-scheme.fish && $CONFIG/gtk/update-scheme.fish
end
exit
end
-set valid_subcommands screenshot record clipboard clipboard-delete emoji-picker wallpaper pip
+if test "$argv[1]" = install
+ set -l valid_modules discord foot fuzzel hypr safeeyes scripts shell
+ contains -- "$argv[2]" $valid_modules && $src/install/$argv[2].fish || error "Invalid module: $argv[2]"
+ exit
+end
+
+set -l valid_subcommands screenshot record clipboard clipboard-delete emoji-picker wallpaper pip
-if contains "$argv[1]" $valid_subcommands
+if contains -- "$argv[1]" $valid_subcommands
$src/$argv[1].fish $argv[2..]
exit
end
@@ -51,9 +57,10 @@ test "$argv[1]" != help && error "Unknown command: $argv[1]"
echo 'Usage: caelestia COMMAND [ ...args ]'
echo
-echo 'COMMAND := help | shell | toggle | workspace-action | scheme | screenshot | record | clipboard | clipboard-delete | emoji-picker | wallpaper | pip'
+echo 'COMMAND := help | install | shell | toggle | workspace-action | scheme | screenshot | record | clipboard | clipboard-delete | emoji-picker | wallpaper | pip'
echo
echo ' help: show this help message'
+echo ' install: install a module'
echo ' shell: start the shell or message it'
echo ' toggle: toggle a special workspace'
echo ' workspace-action: execute a Hyprland workspace dispatcher in the current group'