mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 14:12:41 +00:00
feat: Adds proton pass manager script, updates keybinds and window rules for proton pass.
This commit is contained in:
30
env/.local/scripts/proton-pass-manager
vendored
Executable file
30
env/.local/scripts/proton-pass-manager
vendored
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Manages the proton pass web application. If the app is not open then
|
||||
# it will launch the app (which has a workspace rule that put's it into a
|
||||
# special workspace). If the app is open then it will toggle the special
|
||||
# workspace. This allows the application to not close and be able to hide
|
||||
# and show it quickly using the same keybind that would launch it.
|
||||
|
||||
SCRIPTS="${SCRIPTS}"
|
||||
|
||||
if [[ -z $SCRIPTS ]]; then
|
||||
echo "scripts directory not set"
|
||||
echo "using ~/.local/scripts"
|
||||
SCRIPTS=~/.local/scripts
|
||||
fi
|
||||
|
||||
pattern="pass.proton.me"
|
||||
url="https://$pattern"
|
||||
|
||||
# Get the window address if it exists.
|
||||
window_addr=$(hyprctl clients -j | jq -r ".[] | select((.class | contains(\"$pattern\"))) | .address")
|
||||
|
||||
if [[ -z $window_addr ]]; then
|
||||
echo "No window, launching..."
|
||||
hyprctl dispatch togglespecialworkspace pass
|
||||
eval exec $SCRIPTS/launch-webapp $url
|
||||
else
|
||||
echo "We have a window, toggling special workspace"
|
||||
hyprctl dispatch togglespecialworkspace pass
|
||||
fi
|
||||
Reference in New Issue
Block a user