feat: marking windows, then closing/moving them to current workspace

This commit is contained in:
2025-07-04 13:08:01 +03:00
parent 64e27bc4c8
commit dbcff6dc1e
5 changed files with 76 additions and 4 deletions

View File

@@ -28,8 +28,9 @@ $privateBrowser = zen-browser --private-window
# Or execute your favorite apps at launch like this:
# Le essential hyprland crap
exec-once = hyprpaper & waybar & hypridle & hyprsunset &
exec-once = sleep 1 && ~/.config/hypr/scripts/random_wallpaper.sh
exec-once = hyprpaper
exec-once = waybar & hypridle & hyprsunset &
exec-once = ~/.config/hypr/scripts/random_wallpaper.sh
# exec-once = systemctl --user startexec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP hyprpaper.service
@@ -470,6 +471,18 @@ bind = $mainMod CTRL, G, exec, ~/.config/hypr/scripts/grayscale-toggle.sh
# Game mode
bind = $mainMod SHIFT, G, exec, ~/.config/hypr/scripts/gamemode.sh
# Pin window
bind = $mainMod CTRL, Y, pin, active
# Mark window
bind = $mainMod CTRL, M, tagwindow, marked
# Close marked windows
bind = $mainMod CTRL, W, exec, ~/.config/hypr/scripts/close_marked.sh
# Move marked to current workspace
bind = $mainMod, Y, exec, ~/.config/hypr/scripts/move_marked.sh
# Freeze window
bind = $mainMod SHIFT, F, exec, hyprfreeze -a -s
bind = $mainMod SHIFT, F, tagwindow, zawarudo
@@ -529,6 +542,9 @@ windowrule = move center,class:^(com.saivert.pwvucontrol)$
# Frozen windows
windowrule = bordercolor rgba(ffff00ff) rgba(ffff0055),tag:zawarudo
# Marked windows
windowrule = bordercolor rgba(0000ffff) rgba(aa00ffa5),tag:marked
# Ignore maximize requests from apps. You'll probably like this.
windowrule = suppressevent maximize, class:.*

View File

@@ -1,4 +1,4 @@
wallpaper = eDP-1,/home/greg/Pictures/Wallpapers/current/japan_garden_hd_japanese-1920x1080.png
wallpaper = HDMI-A-1,/home/greg/Pictures/Wallpapers/current/japan_garden_hd_japanese-1920x1080.png
wallpaper = eDP-1,/home/greg/Pictures/Wallpapers/rain_glass_purple_blue_lights2.jpg
wallpaper = HDMI-A-1,/home/greg/Pictures/Wallpapers/rain_glass_purple_blue_lights2.jpg
ipc = on

15
hypr/scripts/close_marked.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
count_closed = 0
while true; do
result=$(hyprctl dispatch closewindow tag:marked)
if [ "$result" != "closeWindow: no window found" ]; then
echo "closed window because '$result'"
((count_closed++))
else
echo "exiting due to '$result'"
break
fi
done

17
hypr/scripts/move_marked.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
count_moved = 0
while true; do
result=$(hyprctl dispatch movetoworkspace e+0,tag:marked)
if [ "$result" != "Window not found" ]; then
echo "moved window because '$result'"
result=$(hyprctl dispatch tagwindow -- -marked tag:marked)
echo "tried umarking and was told $result"
((count_closed++))
else
echo "exiting due to '$result'"
break
fi
done

View File

@@ -1,8 +1,31 @@
#!/usr/bin/env bash
WALLPAPER_DIR="$HOME/Pictures/Wallpapers/current/"
INTRO_DIR="$HOME/Pictures/Wallpapers/intro/"
DELAY=5m
intro() {
if [ -z "$(ls -A "$WALLPAPER_DIR")" ]; then
echo "Current wallpaper folder is empty, nothing to do"
sleep 1
exit 0
fi
WALLPAPER=$(find "$INTRO_DIR" -type l | shuf -n 1)
while true; do
if hyprctl hyprpaper reload ,"$WALLPAPER"; then
sleep 1.5
break
fi
sleep 0.1
done
}
random_wallpaper() {
# Check if folder is not empty
if [ -z "$(ls -A "$WALLPAPER_DIR")" ]; then
@@ -23,6 +46,7 @@ random_wallpaper() {
}
loop() {
intro
while true; do
random_wallpaper
sleep "$DELAY"