Comments (4)
Works great. Thank you
from pyprland.
This looks a bit fragile, what if the user manipulates the window without using the plugin ?
It should reset I guess...
it would only work well for very controlled sequences... but maybe that's fine.
I may have a look at it but with a low priority.
from pyprland.
If the user manipulates the window, such as moving it to another workspace without using a plugin, then I think it doesn't matter. The saved workspace location will only reset the next time using fetch-client-menu or when window is sent back. So even after manipulating the window without using the plugin, the window will still return to the same place from which it was moved, if the keybinding was used. User just won't send the window back if he doesn't need it.
Please take a look at my script that I created today and see how I implemented saving workspace of the window before moving.
This script kinda replicate dwm/awesome tags behaviour so I can very easily toggle windows from all the workspaces into the single view.
#!/bin/bash
if [ $# -eq 0 ]; then
echo "Usage: $0 <window_class>"
exit 1
fi
WINDOW_CLASS="$1"
STORE_FILE="$HOME/.config/hypr/.win_store"
if [ ! -f "$STORE_FILE" ]; then
touch "$STORE_FILE"
fi
CURRENT_WORKSPACE=$(hyprctl activeworkspace -j | jq '.id')
WINDOWS_INFO=$(hyprctl -j clients | jq --arg CLASS "$WINDOW_CLASS" -c '.[] | select(.class == $CLASS)')
echo "$WINDOWS_INFO" | while IFS= read -r WINDOW; do
WINDOW_ADDRESS=$(echo "$WINDOW" | jq -r '.address')
WINDOW_WORKSPACE=$(echo "$WINDOW" | jq '.workspace.id')
if grep -q "$WINDOW_ADDRESS" "$STORE_FILE"; then
ORIGINAL_WORKSPACE=$(grep "$WINDOW_ADDRESS" "$STORE_FILE" | cut -d ' ' -f 2)
if [ "$WINDOW_WORKSPACE" -eq "$CURRENT_WORKSPACE" ]; then
hyprctl dispatch movetoworkspacesilent "$ORIGINAL_WORKSPACE","address:$WINDOW_ADDRESS"
sed -i "/$WINDOW_ADDRESS/d" "$STORE_FILE"
else
hyprctl dispatch movetoworkspace "$CURRENT_WORKSPACE","address:$WINDOW_ADDRESS"
fi
else
echo "$WINDOW_ADDRESS $WINDOW_WORKSPACE" >> "$STORE_FILE"
hyprctl dispatch movetoworkspace "$CURRENT_WORKSPACE","address:$WINDOW_ADDRESS"
fi
done
And my keybindings:
bind = $mainMod CTRL, 1, exec, ~/.config/hypr/scripts/toggle-window neovim
bind = $mainMod CTRL, 2, exec, ~/.config/hypr/scripts/toggle-window Brave-browser
bind = $mainMod CTRL, 3, exec, ~/.config/hypr/scripts/toggle-window VSCodium
bind = $mainMod CTRL, 4, exec, ~/.config/hypr/scripts/toggle-window discord
bind = $mainMod CTRL, 5, exec, ~/.config/hypr/scripts/toggle-window obsidian
from pyprland.
Are you able to test the git version to see if you are happy with the "unfetch_client" command ?
from pyprland.
Related Issues (20)
- Toggle terminal doesnt work in opensuse HOT 7
- [BUG] Excludes = "*" is not working in 2.2.17 HOT 1
- [FEAT] Allow to import additional config files HOT 4
- [BUG] No error output if 'swaybg' isn't found in path
- [FEAT] Allow for different wallpapers on different monitors HOT 3
- [BUG] expose throws an error HOT 2
- [FEAT] Allow wildcards in 'include' config option HOT 6
- [BUG] Configuration not read from `included` files HOT 1
- [FEAT] Implement Smooth Animation for Magnify HOT 2
- [FEAT] Improve error report when config file failed to be parsed HOT 2
- [FEAT] Multiple windows support for scratchpads HOT 57
- [BUG] Error loading plugin pyprland -> JSONDecodeError: Expecting value HOT 12
- [BUG] Fail to parse hyprctl version on Hyprland built from git HOT 1
- [BUG] [NIX] Crash on startup with 2.2.10 HOT 15
- [BUG] pyprland web apps HOT 17
- [BUG] pyprland getting syntax errors and doesn't start HOT 5
- [BUG] Invalid json data at pypr startup HOT 6
- [BUG/cosmetic] Fail to parse hyprctl version HOT 3
- [BUG] Scratchpads and file managers (Nemo, Nautilus) HOT 15
- [FEAT] Add `Anyrun` as `_menu` engine HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyprland.