Coder Social home page Coder Social logo

h3rmt / hyprswitch Goto Github PK

View Code? Open in Web Editor NEW
150.0 1.0 2.0 3.21 MB

A CLI/GUI that allows switching between windows in Hyprland

Home Page: https://crates.io/crates/hyprswitch

License: MIT License

Rust 98.28% Shell 0.59% Nix 0.94% CSS 0.18%
hyprland wayland

hyprswitch's Introduction

hyprswitch

crates.io Docs Tests

A rust CLI/GUI to switch between windows in Hyprland

It can cycle through windows using keyboard shortcuts or/and a GUI.

Windows are sorted by their position on the screen, and can be filtered by class or workspace.

To use the GUI, you need to start the daemon once at the start of Hyprland with exec-once = hyprswitch init & in your config. Subsequent calls to hyprswitch (with the gui command) will send the command to the daemon which will execute the command and update the GUI.

image.png

Installation

From Source

Arch

  • paru -S hyprswitch / yay -S hyprswitch

Nixos

  • add hyprswitch.url = "github:h3rmt/hyprswitch/release"; to flake inputs
  • add specialArgs = { inherit inputs; }; to nixpkgs.lib.nixosSystem
  • add inputs.hyprswitch.packages.x86_64-linux.default to your environment.systemPackages
  • available systems: aarch64-linux, i686-linux, riscv32-linux, riscv64-linux, x86_64-linux

Usage

Once the binary is installed, you can modify your ~/.config/hypr/hyprland.conf.

Parameters

  • --dry-run/-d Print the command that would be executed

  • -v Increase the verbosity level (max: -vv)

  • init Initialize and start the Daemon

    • --switch-ws-on-hover Switch to workspaces when hovering over them in the GUI
    • --stay-open-on-close Don't close GUI when clicking on client (only close with hyprswitch close)
    • --custom-css Specify a path to custom css file
    • --show-title Show the window title in the GUI (fallback to class if title is empty)
  • simple Switch without using the GUI / Daemon (switches directly)

    • --reverse/-r Reverse the order of windows / switch backwards
    • --offset/-o Switch to a specific window offset (default 1)
    • --include-special-workspaces Include special workspaces (e.g., scratchpad)
    • --ignore-workspaces Sort all windows on every monitor like one contiguous workspace
    • --ignore-monitors Sort all windows on matching workspaces on monitors like one big monitor
    • --filter-same-class/-s Only switch between windows that have the same class/type as the currently focused window
    • --filter-current-workspace/-w Only switch between windows that are on the same workspace as the currently focused window
    • --filter-current-monitor/-m Only switch between windows that are on the same monitor as the currently focused window
    • --sort-recent Sort windows by most recently focused
  • gui Starts/Opens the GUI + sends the command to daemon of GUI is already opened

    • --do-initial-execute If the GUI isn't open, also execute the first switch immediately, otherwise just open the GUI
    • Same options as simple
  • close Close the GUI, executes the command to switch window

    • kill Don't switch to the selected window, just close the GUI

Examples:

(Modify the $... variables to use the keys you prefer)

Simple (No GUI)

Next Previous

# 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

Last Focused

# 1 Keybinding to switch to previously focused application
$key = TAB
$modifier = CTRL

bind = $modifier, $key, exec, hyprswitch simple --sort-recent

Same class/type

# 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

GUI

Add exec-once = hyprswitch init & to your ~/.config/hypr/hyprland.conf to start the daemon on startup

Press $modifier + $key to open the GUI, use mouse to click on window

exec-once = hyprswitch init --show-title &

......

$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

GUI + Keyboard Config

Complex Config with submap to allow for many different keybindings when opening hyprswitch (run hyprctl dispatch submap reset if stuck in switch submap)

  • Press (and hold) $modifier + $key to open the GUI and switch trough windows
  • Release $key and press 3 to switch to the third next window
  • Release $key and press/hold $reverse + $key to traverse in reverse order
  • Release $modifier ($modifier_release) to execute the switch and close the gui
exec-once = hyprswitch init --show-title &

......

$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

CSS

Class used:

  • client-image

    .client-image {
      margin: 15px;
    }
  • client-index

    .client-index {
      margin: 6px;
      padding: 5px;
      font-size: 30px;
      font-weight: bold;
      border-radius: 15px;
      border: 3px solid rgba(80, 90, 120, 0.80);
      background-color: rgba(20, 20, 20, 1);
    }
  • client + client_active

    client_active is the client that is currently focused / will be focused when exiting hyprswitch

    .client {
      border-radius: 15px;
      border: 3px solid rgba(80, 90, 120, 0.80);
      background-color: rgba(25, 25, 25, 0.90);
    }
    .client:hover {
      background-color: rgba(40, 40, 50, 1);
    }
    .client_active {
      border: 3px solid rgba(239, 9, 9, 0.94);
    }
  • workspace_frame + workspace_frame_special

    workspace_frame_special is added when workspaceId is < 0 (e.g., scratchpad)

    .workspace {
      font-size: 25px;
      font-weight: bold;
      border-radius: 15px;
      border: 3px solid rgba(70, 80, 90, 0.80);
      background-color: rgba(20, 20, 25, 0.90);
    }
    .workspace_special {
      border: 3px solid rgba(0, 255, 0, 0.4);
    }
  • workspaces

    .workspaces {
      margin: 10px;
    }
  • window

    window {
      border-radius: 15px;
      opacity: 0.85;
      border: 6px solid rgba(15, 170, 190, 0.85);
    }

Default CSS:

.client-image {
    margin: 15px;
}

.client-index {
    margin: 6px;
    padding: 5px;
    font-size: 30px;
    font-weight: bold;
    border-radius: 15px;
    border: 3px solid rgba(80, 90, 120, 0.80);
    background-color: rgba(20, 20, 20, 1);
}

.client {
    border-radius: 15px;
    border: 3px solid rgba(80, 90, 120, 0.80);
    background-color: rgba(25, 25, 25, 0.90);
}

.client:hover {
    background-color: rgba(40, 40, 50, 1);
}

.client_active {
    border: 3px solid rgba(239, 9, 9, 0.94);
}

.workspace {
    font-size: 25px;
    font-weight: bold;
    border-radius: 15px;
    border: 3px solid rgba(70, 80, 90, 0.80);
    background-color: rgba(20, 20, 25, 0.90);
}

.workspace_special {
    border: 3px solid rgba(0, 255, 0, 0.4);
}

.workspaces {
    margin: 10px;
}

window {
    border-radius: 15px;
    opacity: 0.85;
    border: 6px solid rgba(17, 171, 192, 0.85);
}

Custom CSS Example:

.client_active {
    border: 3px solid rgba(239, 9, 9, 0.94);
    background-color: rgba(200, 9, 9, 0.80);
}

.client-image {
    margin: 10px;
}

window {
    opacity: 1;
    border: 6px solid rgba(0, 0, 0, 0.85);
}

Other

Sorting of windows

See tests for more details on how windows get sorted

   1      2  3      4
1  +------+  +------+
2  |  1   |  |  2   |
3  |      |  +------+
4  +------+  +------+
5  +------+  |  4   |
6  |  3   |  |      |
7  +------+  +------+
   1      2  3      4
                  Monitor 1
      Workspace 1           Workspace 2
1  +------+  +------+ | +------+  +------+
2  |  1   |  |  2   |   |  5   |  |  6   |
3  |      |  |      | | |      |  +------+
4  +------+  +------+   +------+  +------+
5  +------+  +------+ | +------+  |  8   |
6  |  3   |  |  4   |   |  7   |  |      |
7  +------+  +------+ | +------+  +------+
   1      2  3      4   1      2  3      4
      1       3    5   6     8   10  11  12
   +----------------------------------------+
1  |  +-------+                      +---+  |
2  |  |   1   |              +---+   | 5 |  |
3  |  |       |    +---+     | 3 |   |   |  |
4  |  +-------+    | 2 |     +---+   |   |  |
5  |               +---+     +---+   |   |  |
6  |                         | 4 |   |   |  |
7  |    +-------+            +---+   +---+  |
8  |    |   6   |         +----+            |
9  |    |       |         | 7  |            |
10 |    +-------+         +----+            |
   +----------------------------------------+
        2       4         7    9

--ignore-workspaces

  • Order without --ignore-workspaces
                   Monitor 1                                   Monitor 2
       Workspace 0           Workspace 1           Workspace 10          Workspace 11
 1  +------+  +------+ | +------+  +------+  |  +------+  +------+ | +------+  +------+
 2  |  1   |  |  2   | | |  5   |  |  6   |  |  |  9   |  |  10  | | |  13  |  |  14  |
 3  |      |  |      | | |      |  +------+  |  |      |  |      | | |      |  +------+
 4  +------+  +------+ | +------+  +------+  |  +------+  +------+ | +------+  +------+
 5  +------+  +------+ | +------+  |  8   |  |  +---------+  +---+ | +------+  |  16  |
 6  |  3   |  |  4   | | |  7   |  |      |  |  |   11    |  |12 | | |  15  |  |      |
 7  +------+  +------+ | +------+  +------+  |  +---------+  +---+ | +------+  +------+
    1      2  3      4   1      2  3      4     5      6  7  8   9   5      6  7   8  9
  • Order with --ignore-workspaces
                   Monitor 1                                   Monitor 2
       Workspace 0           Workspace 1           Workspace 10         Workspace 11
 1  +------+  +------+ | +------+  +------+  |  +------+  +------+ | +------+  +------+
 2  |  1   |  |  2   | | |  3   |  |  4   |  |  |  9   |  |  10  | | |  11  |  |  12  |
 3  |      |  |      | | |      |  +------+  |  |      |  |      | | |      |  +------+
 4  +------+  +------+ | +------+  +------+  |  +------+  +------+ | +------+  +------+
 5  +------+  +------+ | +------+  |  8   |  |  +---------+  +---+ | +------+  |  16  |
 6  |  5   |  |  6   | | |  7   |  |      |  |  |   13    |  |14 | | |  15  |  |      |
 7  +------+  +------+ | +------+  +------+  |  +---------+  +---+ | +------+  +------+
    1      2  3      4   1      2  3      4     5      6  7  8   9   5      6  7   8  9

--ignore-monitors

  • Order without --ignore-monitors
                   Monitor 1                                   Monitor 2
       Workspace 0           Workspace 1           Workspace 10          Workspace 11
 1  +------+  +------+ | +------+  +------+  |  +------+  +------+ | +------+  +------+
 2  |  1   |  |  2   | | |  5   |  |  6   |  |  |  9   |  |  10  | | |  13  |  |  14  |
 3  |      |  |      | | |      |  +------+  |  |      |  |      | | |      |  +------+
 4  +------+  +------+ | +------+  +------+  |  +------+  +------+ | +------+  +------+
 5  +------+  +------+ | +------+  |  8   |  |  +---------+  +---+ | +------+  |  16  |
 6  |  3   |  |  4   | | |  7   |  |      |  |  |   11    |  |12 | | |  15  |  |      |
 7  +------+  +------+ | +------+  +------+  |  +---------+  +---+ | +------+  +------+
    1      2  3      4   1      2  3      4     5      6  7  8   9   5      6  7   8  9
  • Order with --ignore-monitors
                   Monitor 1                                   Monitor 2
       Workspace 0           Workspace 1           Workspace 10          Workspace 11
 1  +------+  +------+ | +------+  +------+  |  +------+  +------+ | +------+  +------+
 2  |  1   |  |  2   | | |  9   |  |  10  |  |  |  3   |  |  4   | | |  11  |  |  12  |
 3  |      |  |      | | |      |  +------+  |  |      |  |      | | |      |  +------+
 4  +------+  +------+ | +------+  +------+  |  +------+  +------+ | +------+  +------+
 5  +------+  +------+ | +------+  |  14  |  |  +---------+  +---+ | +------+  |  16  |
 6  |  5   |  |  6   | | |  13  |  |      |  |  |   7     |  | 8 | | |  15  |  |      |
 7  +------+  +------+ | +------+  +------+  |  +---------+  +---+ | +------+  +------+
    1      2  3      4   1      2  3      4     5      6  7  8   9   5      6  7  8   9

Experimental Environment Variables

  • SIZE_FACTOR i16 [default: 7]: Factor window and workspace size get divided by to shrink them
  • ICON_SIZE i32 [default: 128]: Argument passed to the theme.lookup_icon function (Determines the resolution of the Icon, as it gets scaled to the windowsize regardless of the resolution of the icon)
  • ICON_SCALE i32 [default: 1]: Argument passed to the theme.lookup_icon function (IDK what this does, setting it to anything other than 1 changes nothing)
  • NEXT_INDEX_MAX i32 [default: 5]: Maximum number of windows to display the next index for (can be used to show the next index for the first 5 windows if you have -u bindings for the next/last 5 windows). Setting it to -1 will disable the next index indicator
  • WORKSPACE_GAP usize [default: 15]: Gap between workspaces in the GUI (cant be configured via CSS as the workspace positions are calculated from the real workspace positions)

hyprswitch's People

Contributors

h3rmt avatar justdeeevin avatar ckaznable avatar dependabot[bot] avatar

Stargazers

 avatar Henrique Fernandes avatar pita avatar Mattia Berto avatar  avatar Andrey avatar UmmIt avatar Aaron Wang avatar Evelyn Herzog avatar confusedalex avatar  avatar FÆZEN avatar  avatar Nico Kokonas avatar Krupal Virani avatar Cal Alexander avatar Yoni Firroloni avatar Armin Veres avatar carlosfonseca avatar  avatar xun avatar 0x7C00 avatar Nicholas Romero avatar Sofa avatar Mohammad Zolfaghari avatar  avatar Eugene Noble avatar Andrew Prentice avatar  avatar  avatar KorigamiK avatar  avatar Jon Suderman avatar  avatar TonyHo avatar /boot/winens.elf avatar Bren M avatar Nimrod avatar bitSheriff avatar Tasos avatar Igor Guerrero avatar Bykov Denis avatar  avatar  avatar Mark avatar fuggy avatar Rolf avatar  avatar  avatar  avatar CIHIKU avatar Mattes Rötschke avatar Ariel avatar Matyáš Hýbl avatar Sebastian Speitel avatar Felipe S. S. Schneider avatar Josh Holman avatar Martim Monis avatar  avatar Kerem Gökcek avatar Collin L avatar Eloy García Almadén avatar Patrick G avatar Lucas Patrick avatar Bernardo Kuri avatar Jae-Heon Ji avatar Haru avatar Izel Nakri | izelnakri.eth avatar  avatar Akshay Kalathil avatar  avatar Koppa avatar Dave Conroy avatar  avatar Hayake avatar  avatar AzurIce avatar BlackCatDesigns avatar Evangelos Lioudakis avatar Amro Hatem avatar Gavyn Riebau avatar Paul avatar Altan Avtzi avatar  avatar  avatar Radek Polách avatar Evelyn Huerta avatar Aaron avatar Sergio Alejandro Ribera Costa avatar ZeStig avatar antx avatar L I N U X ( リナックス ) avatar Mateus Alves avatar Slipstream avatar aemogie. avatar Jake Hamilton avatar robin avatar  avatar tom bouillut avatar Jules avatar

Watchers

 avatar

hyprswitch's Issues

Possibility to only show the GUI on one monitor

Hey, i really like this app, but there's one issue i have.

I couldn't give a single damn about those workspaces. I use 3 monitors, and therefore (apparently?) 3 workspaces (even tho i'd prefer to use only one across all monitors, but seemingly not possible in hyprland...)

Now, what i want is to include all window's apps, but only show the GUI itself on my main monitor.

I've read that maybe that's what --ignore-monitors is supposed to do, but i don't get that offset thing... you don't actually mean i have to now create 30 empty workspaces just for this to work?

Live thumbnails

Since hyprland has single-window capture support, there should be a way to get live thumbnails, which would be quite nice

Where to apply the --switch-on-close flag

Hi,
first of all thanks for the great tool :)

I can't figure out where to apply the --switch-on-close flag.
Also the README.md is a bit missleading here as the flag is listed as gui related but does not to be applied to the gui subcommand.

PS: I'm currently running version 2.0.4 installed from AUR.
Greetings

order

My config includes

exec-once= hyprswitch init &
bind= ALT,   TAB,       exec, hyprswitch gui --sort-recent --do-initial-execute
  • With alt+tab, hyprswitch highlights the current app, and goes to the next app. This behavior is right, although it should highlight the following app, not the current.

  • Suppose 3 apps are open, then alt+tab+tab+… reveals: current (1, say) then 2 then 1 then 2 then 3 and sometimes even in different order, depending on the history. This is broken: the correct order would be 2 > 3 > 1 etc., but not 1 > 2 > 1 > 3 etc.

sort-recent on GUI

Thank you again for hyprswitch. It is very good, an excellent app, it allowed me (finally) switching to hyprland.
Coming from Windows, XFCE, Gnome, I am – since years – used to the option --sort-recent. My config sets this option anywhere. I'd like to report minor ‘issues’.

The option --sort-recent activates the Apps in correct order, the functionality is as expected. Perfect.

However, the GUI displays (from left to right) workspace 1, then workspace 2, etc.
Instead, I expect the GUI to display the timeline, i.e., (from left to right) App1, App2, etc., as activated.

Example: Let’s say I have activated
Thunderbird on Workspace 8, then Kitty on workspace 2 and finally Firefox on Workspace 3.
Then the GUI displays (from left to right): Kitty, then Firefox and Thunderbird (they are sorted by workspaces).
But I expect (from left to right): Firefox (left), then Kitty, Thunderbird (right): as activated, irrespective of the workspaces.
Actually, I thought that --ignore-workspaces would do this job, but it serves some other purpose.

Here is my config:

$submap_switch =   switch window 
# allows repeated switching with same keypress that starts the submap
binde=ALT, TAB, exec, hyprswitch --daemon --sort-recent --ignore-workspaces --do-initial-execute
bind=ALT, TAB, submap, $submap_switch

# allows repeated switching with same keypress that starts the submap
binde=ALT SHIFT, TAB, exec, hyprswitch --daemon --sort-recent --ignore-workspaces --do-initial-execute --reverse
bind=ALT SHIFT, TAB, submap, $submap_switch
#
submap=$submap_switch
	# allow repeated window switching in submap (same keys as repeating while starting)
	binde=ALT, TAB, exec, hyprswitch --daemon --sort-recent --ignore-workspaces
	binde=ALT SHIFT, TAB, exec, hyprswitch --daemon --sort-recent --ignore-workspaces --reverse

	# exit submap and kill hyprswitch
	bindrt=ALT, ALT_L, exec, hyprswitch --stop-daemon
	bindrt=ALT, ALT_L, submap, reset

	# if it somehow doesn't close on releasing $switch_release, escape can close too
	bindr=,escape, exec, hyprswitch --stop-daemon
	bindr=,escape, submap, reset
submap=reset

--filter-same-class broken when running in gui

Hi, thank you for your amazing project

I found a bug when using --daemon and --filter-same-class

RUST_BACKTRACE=full hyprswitch --daemon --filter-same-class -v                                                                                                              
WARN Daemon not running, starting daemon                                                                                                                                      
INFO Starting gui                                                                                                                                                             
INFO Starting daemon                                                                                                                                                          
INFO Starting listener on /tmp/hyprswitch.sock                                                                                                                                
WARN No Icon and no desktop file with icon found for term-dotfiles                                                                                                            
thread '<unnamed>' panicked at src/gui.rs:88:111:                                                                                                                             
Failed to get icon path                                                                                                                                                       
stack backtrace:                                                                                                                                                              
   0:     0x5cae82a8d259 - <unknown>                                                                                                                                          
   1:     0x5cae82a378d0 - <unknown>                                                                                                                                          
   2:     0x5cae82a6444e - <unknown>                                                                                                                                          
   3:     0x5cae82a8ea5e - <unknown>                                                                                                                                          
   4:     0x5cae82a8e385 - <unknown>                                                                                                                                          
   5:     0x5cae82a8f27e - <unknown>                                                                                                                                          
   6:     0x5cae82a8edc0 - <unknown>                                                                                                                                          
   7:     0x5cae82a8ed16 - <unknown>                                                                                                                                          
   8:     0x5cae82a8ed03 - <unknown>                                                                                                                                          
   9:     0x5cae829d1164 - <unknown>                                                                                                                                          
  10:     0x5cae829d1762 - <unknown>                                                                                                                                          
  11:     0x5cae829e0220 - <unknown>                                                                                                                                          
  12:     0x5cae829f0865 - <unknown>                                                                                                                                          
  13:     0x5cae82a43f2a - <unknown>                                                                                                                                          
  14:     0x70f914540199 - <unknown>                                                                                                                                          
  15:     0x70f91459f3bf - <unknown>                                                                                                                                          
  16:     0x70f91453f712 - g_main_context_iteration                                                                                                                           
  17:     0x70f914709ed6 - g_application_run                                                                                                                                  
  18:     0x5cae829ebf47 - <unknown>                                                                                                                                          
  19:     0x5cae829eca82 - <unknown>                                                                                                                                          
  20:     0x5cae82a8fef5 - <unknown>                                                                                                                                          
  21:     0x70f9140cc55a - <unknown>                                                                                                                                          
  22:     0x70f914149a3c - <unknown>                                                                                                                                          
  23:                0x0 - <unknown>                                                                                                                                          
[1]    100121 IOT instruction (core dumped)  RUST_BACKTRACE=full hyprswitch --daemon --filter-same-class -v     

Unable to install via either on AUR and cargo

Getting this errors;

cargo install hyprswitch
error: process didn't exit successfully: `rustc -vV` (exit status: 127)
--- stderr
rustc: error while loading shared libraries: libLLVM.so.18.1: cannot open shared object file: No such file or directory

rustc: error while loading shared libraries: libLLVM.so.18.1: cannot open shared object file: No such file or directory
error: target was empty
==> ERROR: A failure occurred in prepare().
    Aborting...
 -> error making: hyprswitch-exit status 4
 -> Failed to install the following packages. Manual intervention is required:
hyprswitch - exit status 4

flickering

I am using thunderbird and firefox. Both react on hitting and releasing ALT (they display/ hide the menu). Switching to firefox or to thunderbird seems to send an additional alt and release alt to the app, which causes some flickering. Of course, this is not an important issue, but perhaps this can be avoided.
See my other issue for the config.
Thanks again.

GUI keyboard shortcuts require an additional press of the ALT key

Hi, I'm having a bit of problems with setting up the gui keyboard shortcuts. I copied the one from the readme, but when I hold ALT, press TAB x times, release ALT, it doesn't switch. I have to press ALT one more time for it to work. Does anyone have the same problem and found a solution? Or is this just the way it works?

Workspace positions

Hi,
as far as i can tell, the gui does position workspaces inside the window based on their real position.
I really like that idea but it can be an issue if there are to many workspaces to fit onto a single screen. Aka the window is getting to wide.
Would it be hard to implement some kind of scrolling or give an option do display a grid view of workspaces?
There may be another option to deal with this.

new release

stopped working on new hyprland release…

exec-once= hyprswitch init &
# bind=ALT,TAB,workspace,previous
bind= ALT,   TAB,       exec, hyprswitch gui --sort-recent --do-initial-execute
bind= ALT SHIFT, TAB,   exec, hyprswitch gui --sort-recent --do-initial-execute --reverse
bind= SUPER, TAB,       exec, hyprswitch gui --sort-recent --do-initial-execute
bind= SUPER SHIFT, TAB, exec, hyprswitch gui --sort-recent --do-initial-execute --reverse
# stop hyprswitch
# bindrt=ALT, ALT_L,    exec, hyprswitch --stop-daemon
bindrt= ALT, ALT_L,     exec, hyprswitch close
bindrt= Super, SUPER_L, exec, hyprswitch close
bindrn= , escape,       exec, hyprswitch close --kill

Unable to install flake on NixOS unstable

warning: Git tree '/etc/nixos' is dirty
building the system configuration...
warning: Git tree '/etc/nixos' is dirty
error: builder for '/nix/store/mdjf98d27mgdd4in5wxkrrimdy9j1wdk-hyprswitch.drv' failed with exit code 101;
       last 10 log lines:
       > Caused by:
       >   process didn't exit successfully: `/build/source/target/release/build/libc-d11dafa8b1a729d3/build-script-build` (exit status: 101)
       >   --- stdout
       >   cargo:rerun-if-changed=build.rs
       >
       >   --- stderr
       >   thread 'main' panicked at /build/cargo-vendor-dir/libc-0.2.153/build.rs:206:9:
       >   failed to run rustc:
       >   note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
       > warning: build failed, waiting for other jobs to finish...
       For full logs, run 'nix log /nix/store/mdjf98d27mgdd4in5wxkrrimdy9j1wdk-hyprswitch.drv'.
error: 1 dependencies of derivation '/nix/store/q0qq8gmgmb32nm17qkkfmqz6mab0rl3d-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/d3hmp7nnjkhfyysixscbihcbfzfzz000-nixos-system-igorlaptop-24.11.20240629.2741b4b.drv' failed to build

Sounds like it's related to a Rust upgrade cause it's on libc.

hyprswitch still working? (new CLI args)

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:

# ╭──	alttab ────────
# bind=ALT,TAB,workspace,previous
bind= ALT,   TAB,      exec, hyprswitch --daemon --sort-recent --do-initial-execute
bind= SUPER, TAB,       exec, hyprswitch --daemon --sort-recent --do-initial-execute
bind= ALT SHIFT, TAB,   exec, hyprswitch --daemon --sort-recent --do-initial-execute --reverse
# stop hyprswitch
# bindrt=ALT, ALT_L,     exec, hyprswitch --stop-daemon
bindrt= ALT, ALT_L,     exec, hyprswitch --stop-daemon
bindrt= Super, SUPER_L, exec, hyprswitch --stop-daemon
bindrn=, escape, exec, pkill hyprswitch

Option to Switch Workspaces Directly Without Cycling Through All Windows

Hello!

I've been using this tool for a few weeks now, and it’s been working great. I have a couple of suggestions that could make it even better.

Currently, when switching workspaces, the tool cycles through all open windows by default. This can be cumbersome if there are many windows in the workspace. For example, if I want to switch from Workspace 1 to Workspace 3, but Workspace 2 has several windows, I end up having to tab through all the windows in Workspace 2 before reaching Workspace 3.

Here’s a scenario:

  • Workspace 1 has 1 window.
  • Workspace 2 has 3 windows.
  • Workspace 3 has 1 window.

If I’m on Workspace 1 and want to switch to Workspace 3, I need to tab through all 3 windows in Workspace 2 before reaching Workspace 3, totaling 4 tabs. This can be inefficient, especially when the windows are not far apart.

It would be more efficient if workspace switching could ignore the windows and just move to the next workspace directly.

Additionally, it would be beneficial if the mouse position remained unchanged during the workspace switch.

It would be great if there were an option to switch workspaces directly without cycling through all windows and without affecting the mouse position.

Unable to hyprswitch init (v. 2.0.4-1) - Invalid type: integer '0'

Tried to install hyprswitch (version 2.0.4-1) via AUR and via Cargo and this is always the output of hyprswitch init -vv:

$ hyprswitch -vv init

DEBUG Checking if daemon is running
DEBUG Daemon not running: Connection refused (os error 111)
INFO Starting daemon
Error: Failed to run daemon

Caused by:
    0: Failed to collect data with config Config { ignore_monitors: false, ignore_workspaces: false, sort_recent: false, filter_current_workspace: false, filter_current_monitor: false, filter_same_class: false, include_special_workspaces: true }
    1: invalid type: integer `0`, expected a boolean at line 21 column 19

Ignore clients with unknown workspaces

hyprswitch
thread 'main' panicked at /usr/src/debug/hyprswitch/hyprswitch-1.1.1/src/sort.rs:213:32:
Workspace 2 not found
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
zsh: IOT instruction (core dumped)  hyprswitch

Scroll/wrap functionality

I have an ultrawide monitor with quite a lot of workspaces and noticed they don't fit on the screen for me.
The GUI also doesn't look as nice as on the screenshots. Maybe wrapping of workspaces could be an answer

image

Issues building from source

I have issues building from source using cargo install --features gui hyprswitch. Without the GUI it works just fine. I get the following errors:

warning: [email protected]:

error: failed to run custom build command for `gtk4-layer-shell-sys v0.2.0`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installdlPuxm/release/build/gtk4-layer-shell-sys-af4c569ab4ff79f5/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=GTK4_LAYER_SHELL_0_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  cargo:warning=
  pkg-config exited with status code 1
  > PKG_CONFIG_PATH=/usr/lib64/pkgconfig/ PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags gtk4-layer-shell-0 gtk4-layer-shell-0 >= 1

  The system library `gtk4-layer-shell-0` required by crate `gtk4-layer-shell-sys` was not found.
  The file `gtk4-layer-shell-0.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
  PKG_CONFIG_PATH contains the following:
      - /usr/lib64/pkgconfig/

  HINT: you may need to install a package such as gtk4-layer-shell-0, gtk4-layer-shell-0-dev or gtk4-layer-shell-0-devel.

warning: build failed, waiting for other jobs to finish...
error: failed to compile `hyprswitch v1.2.4`, intermediate artifacts can be found at `/tmp/cargo-installdlPuxm`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

I googled for a while now and installed all sorts of gtk packages but without success. Can someone tell me more about the dependencies? I can find nothing about it in the Readme. I'm on Fedora and installed gtk-layer-shell-devel and added the following to my .zshrc: export PKG_CONFIG_PATH=/usr/lib64/pkgconfig/, because I was hinted to that by previous errors. Am I missing anything?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.