add waybar
This commit is contained in:
@ -8,6 +8,7 @@
|
||||
{
|
||||
xdg.configFile = {
|
||||
"hypr/hyprland.conf".source = ./hyprland.conf;
|
||||
"hypr/show-hide.sh".source = ./show-hide.sh;
|
||||
};
|
||||
|
||||
imports = [
|
||||
|
@ -22,6 +22,9 @@ monitor=,preferred,auto,auto
|
||||
# exec-once = waybar & hyprpaper & firefox
|
||||
exec-once = wired &
|
||||
|
||||
exec-once = wired
|
||||
exec-once = systemctl --user start polkit-gnome-authentication-agent-1.service
|
||||
|
||||
# Source a file (multi-file configs)
|
||||
# source = ~/.config/hypr/myColors.conf
|
||||
|
||||
@ -207,3 +210,7 @@ bind = $mainMod, P, exec, bwm
|
||||
|
||||
# lock screen
|
||||
bind = $mainMod, L, exec, loginctl lock-session
|
||||
# hide active window
|
||||
bind = $mainMod,H,exec,/home/alice/config/hypr/hide_unhide_window.sh h
|
||||
# show hide window
|
||||
bind = $mainMod,I,exec,/home/alice/config/hypr/hide_unhide_window.sh s
|
||||
|
25
users/alice/home/hypr/show-hide.sh
Normal file
25
users/alice/home/hypr/show-hide.sh
Normal file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
stack_file="/tmp/hide_window_pid_stack.txt"
|
||||
|
||||
function hide_window() {
|
||||
pid=$(hyprctl activewindow -j | jq '.pid')
|
||||
hyprctl dispatch movetoworkspacesilent "88,pid:$pid"
|
||||
echo "$pid" >>$stack_file
|
||||
}
|
||||
|
||||
function show_window() {
|
||||
pid=$(tail -1 $stack_file && sed -i '$d' $stack_file)
|
||||
[ -z "$pid" ] && exit
|
||||
|
||||
current_workspace=$(hyprctl activeworkspace -j | jq '.id')
|
||||
hyprctl dispatch movetoworkspacesilent "$current_workspace,pid:$pid"
|
||||
}
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
if [ "$1" == "h" ]; then
|
||||
hide_window >>/dev/null
|
||||
else
|
||||
show_window >>/dev/null
|
||||
fi
|
||||
fi
|
Reference in New Issue
Block a user