mirror of
https://github.com/caelestia-dots/cli.git
synced 2026-06-05 14:59:29 -05:00
main: workspace action
This commit is contained in:
@@ -90,7 +90,7 @@ else
|
||||
# Change the wallpaper and output change if success
|
||||
hyprctl hyprpaper preload $chosen_wallpaper > /dev/null
|
||||
for monitor in (hyprctl -j monitors | jq -r '.[].name')
|
||||
hyprctl hyprpaper wallpaper "$monitor,$chosen_wallpaper" && log "Changed wallpaper on $monitor to $chosen_wallpaper" > /dev/null
|
||||
hyprctl hyprpaper wallpaper "$monitor,$chosen_wallpaper" > /dev/null && log "Changed wallpaper on $monitor to $chosen_wallpaper"
|
||||
end
|
||||
|
||||
# Unload unused wallpapers to preserve memory
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/fish
|
||||
|
||||
cd (dirname (status filename)) || exit
|
||||
cd (dirname (realpath (status filename))) || exit
|
||||
|
||||
. ./util.fish
|
||||
|
||||
@@ -18,6 +18,11 @@ if test "$argv[1]" = shell
|
||||
exit
|
||||
end
|
||||
|
||||
if test "$argv[1]" = workspace-action
|
||||
./workspace-action.sh $argv[2..]
|
||||
exit
|
||||
end
|
||||
|
||||
if test "$argv[1]" = change-wallpaper
|
||||
./change-wallpaper.fish $argv[2..]
|
||||
exit
|
||||
@@ -27,8 +32,9 @@ test "$argv[1]" != help && error "Unknown command: $argv[1]"
|
||||
|
||||
echo 'Usage: caelestia COMMAND'
|
||||
echo
|
||||
echo 'COMMAND := help | shell | change-wallpaper'
|
||||
echo 'COMMAND := help | shell | workspace-action | change-wallpaper'
|
||||
echo
|
||||
echo ' help: show this help message'
|
||||
echo ' shell: send a message to the shell'
|
||||
echo ' workspace-action: execute a Hyprland workspace dispatcher in the current group'
|
||||
echo ' change-wallpaper: change the wallpaper'
|
||||
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
active_ws=$(hyprctl activeworkspace -j | jq -r '.id')
|
||||
|
||||
if [[ "$1" == *"group" ]]; then
|
||||
# Move to group
|
||||
hyprctl dispatch "${1::-5}" $((($2 - 1) * 10 + ${active_ws:0-1}))
|
||||
else
|
||||
# Move to ws in group
|
||||
hyprctl dispatch "$1" $((((active_ws - 1) / 10) * 10 + $2))
|
||||
fi
|
||||
Reference in New Issue
Block a user