Closed aloispichler closed 2 months ago
I did some breaking changes to the CLI (Split them into different sucommands) but did Not manage to merge the PR with the updated README.md (some small fixes are still Missing) (but hyprswitch --help
should Work?)
Please look at the README.md in the dev branch for the updated CLI Options
Im planing to add a more detailed description for the Commands and their Options to the README
(Modify the $... variables to use the keys you prefer)
# 2 Keybindings to switch to 'next' or 'previous' window
$key = TAB
$modifier = CTRL
$reverse = SHIFT
bind = $modifier, $key, exec, hyprswitch simple
bind = $modifier $reverse, $key, exec, hyprswitch simple -r
# 1 Keybinding to switch to previously focused application
$key = TAB
$modifier = CTRL
bind = $modifier, $key, exec, hyprswitch simple --sort-recent
# 2 Keybindings to switch to next' or 'previous' window of same class/type
$key = TAB
$modifier = CTRL
$reverse = SHIFT
bind = $modifier, $key, exec, hyprswitch simple -s
bind = $modifier $reverse, $key, exec, hyprswitch simple -s -r
Add exec-once = hyprswitch init &
to your ~/.config/hypr/hyprland.conf
to start the daemon on startup
$key = TAB
$modifier = SUPER
$switch_release = SUPER_L
# open hyprswitch
bind = $modifier, $key, exec, hyprswitch gui
# close hyprswitch
bindr = $modifier, $switch_release, exec, hyprswitch close
# if it somehow doesn't close on releasing $switch_release, escape can kill (doesnt switch)
bindrn = ,escape, exec, hyprswitch close --kill
Complex Config with submap to allow for many different keybindings when opening hyprswitch
(run hyprctl dispatch submap reset
if stuck in switch submap)
$key = TAB
$modifier = ALT
$modifier_release = ALT_L
$reverse = SHIFT
# allows repeated switching with same keypress that starts the submap
binde = $modifier, $key, exec, hyprswitch gui --do-initial-execute
bind = $modifier, $key, submap, switch
# allows repeated switching with same keypress that starts the submap
binde = $modifier $reverse, $key, exec, hyprswitch gui --do-initial-execute -r
bind = $modifier $reverse, $key, submap, switch
submap = switch
# allow repeated window switching in submap (same keys as repeating while starting)
binde = $modifier, $key, exec, hyprswitch gui
binde = $modifier $reverse, $key, exec, hyprswitch gui -r
# switch to specific window offset (TODO replace with a more dynamic solution)
bind = $modifier, 1, exec, hyprswitch gui --offset=1
bind = $modifier, 2, exec, hyprswitch gui --offset=2
bind = $modifier, 3, exec, hyprswitch gui --offset=3
bind = $modifier, 4, exec, hyprswitch gui --offset=4
bind = $modifier, 5, exec, hyprswitch gui --offset=5
bind = $modifier $reverse, 1, exec, hyprswitch gui --offset=1 -r
bind = $modifier $reverse, 2, exec, hyprswitch gui --offset=2 -r
bind = $modifier $reverse, 3, exec, hyprswitch gui --offset=3 -r
bind = $modifier $reverse, 4, exec, hyprswitch gui --offset=4 -r
bind = $modifier $reverse, 5, exec, hyprswitch gui --offset=5 -r
# exit submap and stop hyprswitch
bindrt = $modifier, $modifier_release, exec, hyprswitch close
bindrt = $modifier, $modifier_release, submap, reset
# if it somehow doesn't close on releasing $switch_release, escape can kill (doesnt switch)
bindr = ,escape, exec, hyprswitch close --kill
bindr = ,escape, submap, reset
submap = reset
Updated Config:
# ╭── alttab ────────
# bind=ALT,TAB,workspace,previous
bind= ALT, TAB, exec, hyprswitch gui --sort-recent --do-initial-execute
bind= SUPER, TAB, exec, hyprswitch gui --sort-recent --do-initial-execute
bind= ALT SHIFT, TAB, exec, hyprswitch gui --sort-recent --do-initial-execute --reverse
# stop hyprswitch
# bindrt=ALT, ALT_L, exec, hyprswitch close
bindrt= ALT, , exec, hyprswitch close
bindrt= Super, SUPER_L, exec, hyprswitch close
bindrn=, escape, exec, hyprswitch close --kill
Add the exec-once = hyprswitch init &
from the README
new help:
A CLI/GUI that allows switching between windows in Hyprland
Usage: hyprswitch [OPTIONS] <COMMAND>
Commands:
init Initialize and run the Daemon
gui Starts/Opens the GUI + sends the command to daemon of GUI is already opened
simple Switch without using the GUI / Daemon (switches directly)
close Close the GUI, executes the command to switch window
help Print this message or the help of the given subcommand(s)
Options:
-d, --dry-run Print the command that would be executed
-v... Increase the verbosity level (max: -vv)
-h, --help Print help
-V, --version Print version
The updated GUI config now does nothing here, that is, it does not change windows (but it does not show notifications neither).
No: The result of hyprswitch --help
is:
Error: Failed to parse command line arguments
Caused by: A CLI/GUI that allows …
… and then your other text is shown.
Here, hyprswitch stopped working entirely, unfortunately.
Can you run hyprswitch -vv init
in a Terminal and check If running hyprswitch -vv gui
now works
Yes, this works. It seems that I need to run hyprswitch -vv init
first? I missed this in your post before, I am sorry.
Thanks again!
I think an additional Toast if the daemon isn't running would be useful
I just followed your instructions and it worked in nixos. Thank you!
Since 2.0.3, everytime hyprswitch is invoked, I am getting a notification as (1U) Hyprswitch (2.0.3) Error Unable to parse CLI Argument (visit …) Failed to parse command line arguments Caused by: error unexpected argument '--deamon and error unexpected argument '--stop-deamon
Even
hyprswitch --help
says: Error: “Failed to parse command line arguments” and sends the notification. Hmm… something went severely wrong.Here is my config: