diff --git a/hypr/hyprland.conf b/hypr/hyprland.conf index 0718783..5afe7c0 100644 --- a/hypr/hyprland.conf +++ b/hypr/hyprland.conf @@ -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:.* diff --git a/hypr/hyprpaper.conf b/hypr/hyprpaper.conf index 3767437..9996056 100644 --- a/hypr/hyprpaper.conf +++ b/hypr/hyprpaper.conf @@ -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 diff --git a/hypr/scripts/close_marked.sh b/hypr/scripts/close_marked.sh new file mode 100755 index 0000000..1340f91 --- /dev/null +++ b/hypr/scripts/close_marked.sh @@ -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 diff --git a/hypr/scripts/move_marked.sh b/hypr/scripts/move_marked.sh new file mode 100755 index 0000000..4db9fc5 --- /dev/null +++ b/hypr/scripts/move_marked.sh @@ -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 diff --git a/hypr/scripts/random_wallpaper.sh b/hypr/scripts/random_wallpaper.sh index 5b9e8ea..2b00e4d 100755 --- a/hypr/scripts/random_wallpaper.sh +++ b/hypr/scripts/random_wallpaper.sh @@ -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"