diff --git a/Configs/hypr/hyprland.conf b/Configs/hypr/hyprland.conf index 3382f15..d665f8a 100644 --- a/Configs/hypr/hyprland.conf +++ b/Configs/hypr/hyprland.conf @@ -148,10 +148,10 @@ gestures { # Example per-device config # See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more -device { - name = epic-mouse-v1 - sensitivity = -0.3 -} +# device { +# name = epic-mouse-v1 +# sensitivity = -0.3 +# } ############################## ### WINDOWS AND WORKSPACES ### diff --git a/Configs/hypr/keybindings.conf b/Configs/hypr/keybindings.conf index 984a835..2c2aea2 100644 --- a/Configs/hypr/keybindings.conf +++ b/Configs/hypr/keybindings.conf @@ -4,7 +4,7 @@ # See https://wiki.hyprland.org/Configuring/Keywords/ $terminal = kitty -$fileManager = dolphin +$fileManager = nautilus $menu = rofi -show drun $editor = code $browser = brave @@ -13,10 +13,11 @@ $browser = brave ### KEYBINDINGS ### ################### +# See https://wiki.hyprland.org/Configuring/Binds/ # See https://wiki.hyprland.org/Configuring/Keywords/ $mainMod = SUPER # Sets "Windows" key as main modifier -# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more +# Application shortcuts bind = $mainMod, W, exec, $terminal bind = $mainMod, R, exec, $menu bind = $mainMod, E, exec, $fileManager @@ -25,6 +26,11 @@ bind = $mainMod, B, exec, $browser bind = $mainMod, K, exec, keepassxc bind = $mainMod, V, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy +# Change wallpaper +bind = CONTROL_ALT, B, exec, $HOME/.config/hypr/scripts/wallpaper.sh -prev +bind = CONTROL_ALT, N, exec, $HOME/.config/hypr/scripts/wallpaper.sh -next + +# Restart Waybar bind = $mainMod, F2, exec, killall waybar && waybar -c $HOME/.config/waybar/config.jsonc -s $HOME/.config/waybar/styles.css && dunstify "Waybar restarted" bind = $mainMod, Q, killactive, diff --git a/Configs/hypr/scripts/wallpaper.sh b/Configs/hypr/scripts/wallpaper.sh new file mode 100755 index 0000000..61f8174 --- /dev/null +++ b/Configs/hypr/scripts/wallpaper.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +WALLPAPER_DIR="$HOME/Pictures/Wallpapers" + +INDEX_FILE="$HOME/.current_wallpaper_index" + +if [ ! -f "$INDEX_FILE" ]; then + echo 0 > "$INDEX_FILE" +fi + +WALLPAPERS=("$WALLPAPER_DIR"/*) +WALLPAPER_COUNT=${#WALLPAPERS[@]} + +CURRENT_INDEX=$(<"$INDEX_FILE") + +if [[ "$1" == "-next" ]]; then + ((CURRENT_INDEX=(CURRENT_INDEX + 1) % WALLPAPER_COUNT)) +elif [[ "$1" == "-prev" ]]; then + ((CURRENT_INDEX=(CURRENT_INDEX - 1 + WALLPAPER_COUNT) % WALLPAPER_COUNT)) +else + exit 0 +fi + +echo "$CURRENT_INDEX" > "$INDEX_FILE" + +SELECTED_WALLPAPER="${WALLPAPERS[$CURRENT_INDEX]}" +CURRENT_WALLPAPER=$(hyprctl -j monitors | jq -r '.[] | select(.name=="eDP-1") | .wallpaper') + +if [ "$CURRENT_WALLPAPER" != "$SELECTED_WALLPAPER" ]; then + hyprctl hyprpaper preload "$SELECTED_WALLPAPER" + hyprctl hyprpaper wallpaper "eDP-1,$SELECTED_WALLPAPER" +fi