From 16621bef0e8e3419f82389ba841b97db40a555b1 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Mon, 1 Jan 2024 15:13:32 +0900 Subject: - Breaking Changes. - Quick Edit script moved to user scripts - I understand some users wants to use other editor - RofiBeats moved to user scripts - This is because users wants their own stations :) - RofiBeats keybinds changed to SUPER SHIFT M keybind - Keybinds to change layout SUPER ALT L - Wlogout Script adjusted with 4K. - Wallpaper Scripts are moved to UserScripts. This is because if users has a different location of wallpapers and also wants a different animations --- config/hypr/UserConfigs/Monitors.conf | 2 +- config/hypr/UserConfigs/Startup_Apps.conf | 2 +- config/hypr/UserScripts/00-Readme | 0 config/hypr/UserScripts/QuickEdit.sh | 53 ++++++++++++++++++ config/hypr/UserScripts/RofiBeats.sh | 48 +++++++++++++++++ config/hypr/UserScripts/Wallpaper.sh | 24 +++++++++ config/hypr/UserScripts/WallpaperRandom.sh | 35 ++++++++++++ config/hypr/UserScripts/WallpaperSelect.sh | 86 ++++++++++++++++++++++++++++++ config/hypr/configs/Keybinds.conf | 19 +++---- config/hypr/scripts/KeyHints.sh | 2 +- config/hypr/scripts/QuickEdit.sh | 53 ------------------ config/hypr/scripts/RofiBeats.sh | 48 ----------------- config/hypr/scripts/Wallpaper.sh | 24 --------- config/hypr/scripts/WallpaperRandom.sh | 35 ------------ config/hypr/scripts/WallpaperSelect.sh | 86 ------------------------------ config/hypr/scripts/Wlogout.sh | 8 +-- 16 files changed, 263 insertions(+), 262 deletions(-) mode change 100644 => 100755 config/hypr/UserScripts/00-Readme create mode 100755 config/hypr/UserScripts/QuickEdit.sh create mode 100755 config/hypr/UserScripts/RofiBeats.sh create mode 100755 config/hypr/UserScripts/Wallpaper.sh create mode 100755 config/hypr/UserScripts/WallpaperRandom.sh create mode 100755 config/hypr/UserScripts/WallpaperSelect.sh delete mode 100755 config/hypr/scripts/QuickEdit.sh delete mode 100755 config/hypr/scripts/RofiBeats.sh delete mode 100755 config/hypr/scripts/Wallpaper.sh delete mode 100755 config/hypr/scripts/WallpaperRandom.sh delete mode 100755 config/hypr/scripts/WallpaperSelect.sh diff --git a/config/hypr/UserConfigs/Monitors.conf b/config/hypr/UserConfigs/Monitors.conf index ca2ef0e6..3e758c0a 100644 --- a/config/hypr/UserConfigs/Monitors.conf +++ b/config/hypr/UserConfigs/Monitors.conf @@ -15,7 +15,7 @@ monitor=,preferred,auto,1 #monitor = eDP-1, preferred, auto, 1 #monitor = eDP-1, 2560x1440@165, 0x0, 1 #own screen -#monitor = DP-2, preferred, auto, 1 +#monitor = DP-3, 1920x1080@240, auto, 1 #monitor = DP-1, preferred, auto, 1 #monitor = HDMI-A-1, preferred,auto,1 diff --git a/config/hypr/UserConfigs/Startup_Apps.conf b/config/hypr/UserConfigs/Startup_Apps.conf index 2aacba44..5ba2dbf4 100644 --- a/config/hypr/UserConfigs/Startup_Apps.conf +++ b/config/hypr/UserConfigs/Startup_Apps.conf @@ -4,7 +4,7 @@ $scriptsDir = $HOME/.config/hypr/scripts $UserscriptsDir = $HOME/.config/hypr/UserScripts $lock = $scriptsDir/LockScreen.sh -$SwwwRandom = $scriptsDir/WallpaperRandom.sh +$SwwwRandom = $UserscriptsDir/WallpaperRandom.sh $WallpaperPath = $HOME/Pictures/wallpapers diff --git a/config/hypr/UserScripts/00-Readme b/config/hypr/UserScripts/00-Readme old mode 100644 new mode 100755 diff --git a/config/hypr/UserScripts/QuickEdit.sh b/config/hypr/UserScripts/QuickEdit.sh new file mode 100755 index 00000000..9c7cdffc --- /dev/null +++ b/config/hypr/UserScripts/QuickEdit.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +defaultDir="$HOME/.config/hypr/configs" +userDir="$HOME/.config/hypr/UserConfigs" + +menu(){ + printf "1. view Env-variables\n" + printf "2. view Window-Rules\n" + printf "3. view Startup_Apps\n" + printf "4. view User-Keybinds\n" + printf "5. view Monitors\n" + printf "6. view Laptop-Keybinds\n" + printf "7. view User-Settings\n" + printf "8. view Default-Settings\n" + printf "9. view Default-Keybinds\n" +} + +main() { + choice=$(menu | rofi -dmenu -config ~/.config/rofi/config-compact.rasi | cut -d. -f1) + case $choice in + 1) + kitty -e nano "$userDir/ENVariables.conf" + ;; + 2) + kitty -e nano "$userDir/WindowRules.conf" + ;; + 3) + kitty -e nano "$userDir/Startup_Apps.conf" + ;; + 4) + kitty -e nano "$userDir/UserKeybinds.conf" + ;; + 5) + kitty -e nano "$userDir/Monitors.conf" + ;; + 6) + kitty -e nano "$userDir/Laptops.conf" + ;; + 7) + kitty -e nano "$userDir/UserSettings.conf" + ;; + 8) + kitty -e nano "$defaultDir/Settings.conf" + ;; + 9) + kitty -e nano "$defaultDir/Keybinds.conf" + ;; + *) + ;; + esac +} + +main \ No newline at end of file diff --git a/config/hypr/UserScripts/RofiBeats.sh b/config/hypr/UserScripts/RofiBeats.sh new file mode 100755 index 00000000..405451f5 --- /dev/null +++ b/config/hypr/UserScripts/RofiBeats.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +# Directory for icons +iDIR="$HOME/.config/swaync/icons" + +# Note: You can add more options below with the following format: +# ["TITLE"]="link" + +# Define menu options as an associative array +declare -A menu_options=( + ["Lofi Girl ☕️🎶"]="https://play.streamafrica.net/lofiradio" + ["96.3 Easy Rock 📻🎶"]="https://radio-stations-philippines.com/easy-rock" + ["Ghibli Music 🎻🎶"]="https://youtube.com/playlist?list=PLNi74S754EXbrzw-IzVhpeAaMISNrzfUy&si=rqnXCZU5xoFhxfOl" + ["Top Youtube Music 2023 ☕️🎶"]="https://youtube.com/playlist?list=PLDIoUOhQQPlXr63I_vwF9GD8sAKh77dWU&si=y7qNeEVFNgA-XxKy" + ["Chillhop ☕️🎶"]="http://stream.zeno.fm/fyn8eh3h5f8uv" + ["SmoothChill ☕️🎶"]="https://media-ssl.musicradio.com/SmoothChill" + ["Relaxing Music ☕️🎶"]="https://youtube.com/playlist?list=PLMIbmfP_9vb8BCxRoraJpoo4q1yMFg4CE" + ["Youtube Remix 📻🎶"]="https://youtube.com/playlist?list=PLeqTkIUlrZXlSNn3tcXAa-zbo95j0iN-0" + ["Korean Drama OST 📻🎶"]="https://youtube.com/playlist?list=PLUge_o9AIFp4HuA-A3e3ZqENh63LuRRlQ" +) + +# Function for displaying notifications +notification() { + notify-send -u normal -i "$iDIR/music.png" "Playing now: $@" +} + +# Main function +main() { + choice=$(printf "%s\n" "${!menu_options[@]}" | rofi -dmenu -config ~/.config/rofi/config-rofi-Beats.rasi -i -p "") + + if [ -z "$choice" ]; then + exit 1 + fi + + link="${menu_options[$choice]}" + + notification "$choice" + + # Check if the link is a playlist + if [[ $link == *playlist* ]]; then + mpv --shuffle --vid=no "$link" + else + mpv "$link" + fi +} + +# Check if an online music process is running and send a notification, otherwise run the main function +pkill -f http && notify-send -u low -i "$iDIR/music.png" "Online Music stopped" || main diff --git a/config/hypr/UserScripts/Wallpaper.sh b/config/hypr/UserScripts/Wallpaper.sh new file mode 100755 index 00000000..d75d2eab --- /dev/null +++ b/config/hypr/UserScripts/Wallpaper.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +DIR="$HOME/Pictures/wallpapers" +SCRIPTSDIR="$HOME/.config/hypr/scripts" + +PICS=($(find ${DIR} -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -o -name "*.gif" \))) +RANDOMPICS=${PICS[ $RANDOM % ${#PICS[@]} ]} + + +# Transition config +FPS=60 +TYPE="random" +DURATION=1 +BEZIER=".43,1.19,1,.4" +SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER" + + +swww query || swww init && swww img ${RANDOMPICS} $SWWW_PARAMS + + +${SCRIPTSDIR}/PywalSwww.sh +sleep 1 +${SCRIPTSDIR}/Refresh.sh + diff --git a/config/hypr/UserScripts/WallpaperRandom.sh b/config/hypr/UserScripts/WallpaperRandom.sh new file mode 100755 index 00000000..13bd2995 --- /dev/null +++ b/config/hypr/UserScripts/WallpaperRandom.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# This script will randomly go through the files of a directory, setting it +# up as the wallpaper at regular intervals +# +# NOTE: this script uses bash (not POSIX shell) for the RANDOM variable + +pywal_refresh=$HOME/.config/hypr/scripts/RefreshNoWaybar.sh + +if [[ $# -lt 1 ]] || [[ ! -d $1 ]]; then + echo "Usage: + $0 " + exit 1 +fi + +# Edit below to control the images transition +export SWWW_TRANSITION_FPS=60 +export SWWW_TRANSITION_TYPE=simple + +# This controls (in seconds) when to switch to the next image +INTERVAL=1800 + +while true; do + find "$1" \ + | while read -r img; do + echo "$((RANDOM % 1000)):$img" + done \ + | sort -n | cut -d':' -f2- \ + | while read -r img; do + swww img "$img" + $pywal_refresh + sleep $INTERVAL + + done +done diff --git a/config/hypr/UserScripts/WallpaperSelect.sh b/config/hypr/UserScripts/WallpaperSelect.sh new file mode 100755 index 00000000..5c3f2b94 --- /dev/null +++ b/config/hypr/UserScripts/WallpaperSelect.sh @@ -0,0 +1,86 @@ +#!/bin/bash + +SCRIPTSDIR="$HOME/.config/hypr/scripts" + +# WALLPAPERS PATH +DIR="$HOME/Pictures/wallpapers" + +# Transition config +FPS=30 +TYPE="wipe" +DURATION=1 +BEZIER=".43,1.19,1,.4" +SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION" + +# Check if swaybg is running +if pidof swaybg > /dev/null; then + pkill swaybg +fi + +# Retrieve image files +PICS=($(ls "${DIR}" | grep -E ".jpg$|.jpeg$|.png$|.gif$")) +RANDOM_PIC="${PICS[$((RANDOM % ${#PICS[@]}))]}" +RANDOM_PIC_NAME="${#PICS[@]}. random" + +# Rofi command +rofi_command="rofi -show -dmenu -config ~/.config/rofi/config-wallpaper.rasi" + +menu() { + for i in "${!PICS[@]}"; do + # Displaying .gif to indicate animated images + if [[ -z $(echo "${PICS[$i]}" | grep .gif$) ]]; then + printf "$(echo "${PICS[$i]}" | cut -d. -f1)\x00icon\x1f${DIR}/${PICS[$i]}\n" + else + printf "${PICS[$i]}\n" + fi + done + + printf "$RANDOM_PIC_NAME\n" +} + +swww query || swww init + +main() { + choice=$(menu | ${rofi_command}) + + # No choice case + if [[ -z $choice ]]; then + exit 0 + fi + + # Random choice case + if [ "$choice" = "$RANDOM_PIC_NAME" ]; then + swww img "${DIR}/${RANDOM_PIC}" $SWWW_PARAMS + exit 0 + fi + + # Find the index of the selected file + pic_index=-1 + for i in "${!PICS[@]}"; do + filename=$(basename "${PICS[$i]}") + if [[ "$filename" == "$choice"* ]]; then + pic_index=$i + break + fi + done + + if [[ $pic_index -ne -1 ]]; then + swww img "${DIR}/${PICS[$pic_index]}" $SWWW_PARAMS + else + echo "Image not found." + exit 1 + fi +} + +# Check if rofi is already running +if pidof rofi > /dev/null; then + pkill rofi + exit 0 +fi + +main + +sleep 0.5 +${SCRIPTSDIR}/PywalSwww.sh +sleep 0.2 +${SCRIPTSDIR}/Refresh.sh diff --git a/config/hypr/configs/Keybinds.conf b/config/hypr/configs/Keybinds.conf index 84b78cff..2223bf6b 100644 --- a/config/hypr/configs/Keybinds.conf +++ b/config/hypr/configs/Keybinds.conf @@ -3,32 +3,33 @@ $mainMod = SUPER $scriptsDir = $HOME/.config/hypr/scripts +$UserScripts = $HOME/.config/hypr/UserScripts bind = CTRL ALT, Delete, exec, hyprctl dispatch exit 0 +bind = $mainMod, Q, killactive, +bind = $mainMod, F, fullscreen bind = $mainMod SHIFT, Q, closewindow, bind = $mainMod SHIFT, F, togglefloating, bind = $mainMod ALT, F, exec, hyprctl dispatch workspaceopt allfloat -bind = $mainMod, F, fullscreen -bind = $mainMod, Q, killactive, bind = CTRL ALT, L, exec, $scriptsDir/LockScreen.sh bind = CTRL ALT, P, exec, $scriptsDir/Wlogout.sh # FEATURES / EXTRAS +bind = $mainMod, H, exec, $scriptsDir/KeyHints.sh # Small help file bind = $mainMod ALT, R, exec, $scriptsDir/Refresh.sh # Refresh waybar, swaync, rofi -bind = $mainMod CTRL, S, exec, $scriptsDir/RofiBeats.sh # online music bind = $mainMod ALT, E, exec, $scriptsDir/RofiEmoji.sh # emoji -bind = $mainMod, H, exec, $scriptsDir/KeyHints.sh # Small help file -bind = $mainMod, E, exec, $scriptsDir/QuickEdit.sh # Quick Edit Hyprland Settings bind = $mainMod SHIFT, B, exec, $scriptsDir/ChangeBlur.sh # Toggle blur settings bind = $mainMod SHIFT, G, exec, $scriptsDir/GameMode.sh # animations ON/OFF bind = $mainMod ALT, K, exec, $scriptsDir/SwitchKeyboardLayout.sh # Switch Keyboard Layout -bind = $mainMod, Space, exec, $scriptsDir/ChangeLayout.sh # Toggle Master or Dwindle Layout +bind = $mainMod ALT, L, exec, $scriptsDir/ChangeLayout.sh # Toggle Master or Dwindle Layout bind = $mainMod ALT, V, exec, $scriptsDir/ClipManager.sh # Clipboard Manager bind = $mainMod SHIFT, N, exec, swaync-client -t -sw # swayNC panel -# Wallpaper related keybinds -bind = $mainMod, W, exec, $scriptsDir/WallpaperSelect.sh # Select wallpaper to apply -bind = CTRL ALT, W, exec, $scriptsDir/Wallpaper.sh # Random wallpapers +# FEATURES / EXTRAS (UserScripts) +bind = $mainMod, E, exec, $UserScripts/QuickEdit.sh # Quick Edit Hyprland Settings +bind = $mainMod ALT, M, exec, $UserScripts/RofiBeats.sh # online music +bind = $mainMod, W, exec, $UserScripts/WallpaperSelect.sh # Select wallpaper to apply +bind = CTRL ALT, W, exec, $UserScripts/Wallpaper.sh # Random wallpapers # Waybar / Bar related bind = $mainMod, B, exec, killall -SIGUSR1 waybar # Toggle hide/show waybar diff --git a/config/hypr/scripts/KeyHints.sh b/config/hypr/scripts/KeyHints.sh index 180befa1..90c9ec47 100755 --- a/config/hypr/scripts/KeyHints.sh +++ b/config/hypr/scripts/KeyHints.sh @@ -57,7 +57,7 @@ yad --width=$dynamic_width --height=$dynamic_height \ "CTRL ALT L" "screen lock" "(swaylock)" \ "CTRL ALT Del" "Hyprland Exit" "(SAVE YOUR WORK!!!)" \ " F" "Fullscreen" "Toggles to full screen" \ -" Spacebar" "Toggle Dwindle | Master Layout" "Hyprland Layout" \ +" ALT L" "Toggle Dwindle | Master Layout" "Hyprland Layout" \ " Shift F" "Toggle float" "single window" \ " ALT F" "Toggle all windows to float" "all windows" \ " Shift B" "Toggle Blur" "normal or less blur" \ diff --git a/config/hypr/scripts/QuickEdit.sh b/config/hypr/scripts/QuickEdit.sh deleted file mode 100755 index 9c7cdffc..00000000 --- a/config/hypr/scripts/QuickEdit.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash - -defaultDir="$HOME/.config/hypr/configs" -userDir="$HOME/.config/hypr/UserConfigs" - -menu(){ - printf "1. view Env-variables\n" - printf "2. view Window-Rules\n" - printf "3. view Startup_Apps\n" - printf "4. view User-Keybinds\n" - printf "5. view Monitors\n" - printf "6. view Laptop-Keybinds\n" - printf "7. view User-Settings\n" - printf "8. view Default-Settings\n" - printf "9. view Default-Keybinds\n" -} - -main() { - choice=$(menu | rofi -dmenu -config ~/.config/rofi/config-compact.rasi | cut -d. -f1) - case $choice in - 1) - kitty -e nano "$userDir/ENVariables.conf" - ;; - 2) - kitty -e nano "$userDir/WindowRules.conf" - ;; - 3) - kitty -e nano "$userDir/Startup_Apps.conf" - ;; - 4) - kitty -e nano "$userDir/UserKeybinds.conf" - ;; - 5) - kitty -e nano "$userDir/Monitors.conf" - ;; - 6) - kitty -e nano "$userDir/Laptops.conf" - ;; - 7) - kitty -e nano "$userDir/UserSettings.conf" - ;; - 8) - kitty -e nano "$defaultDir/Settings.conf" - ;; - 9) - kitty -e nano "$defaultDir/Keybinds.conf" - ;; - *) - ;; - esac -} - -main \ No newline at end of file diff --git a/config/hypr/scripts/RofiBeats.sh b/config/hypr/scripts/RofiBeats.sh deleted file mode 100755 index 405451f5..00000000 --- a/config/hypr/scripts/RofiBeats.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -# Directory for icons -iDIR="$HOME/.config/swaync/icons" - -# Note: You can add more options below with the following format: -# ["TITLE"]="link" - -# Define menu options as an associative array -declare -A menu_options=( - ["Lofi Girl ☕️🎶"]="https://play.streamafrica.net/lofiradio" - ["96.3 Easy Rock 📻🎶"]="https://radio-stations-philippines.com/easy-rock" - ["Ghibli Music 🎻🎶"]="https://youtube.com/playlist?list=PLNi74S754EXbrzw-IzVhpeAaMISNrzfUy&si=rqnXCZU5xoFhxfOl" - ["Top Youtube Music 2023 ☕️🎶"]="https://youtube.com/playlist?list=PLDIoUOhQQPlXr63I_vwF9GD8sAKh77dWU&si=y7qNeEVFNgA-XxKy" - ["Chillhop ☕️🎶"]="http://stream.zeno.fm/fyn8eh3h5f8uv" - ["SmoothChill ☕️🎶"]="https://media-ssl.musicradio.com/SmoothChill" - ["Relaxing Music ☕️🎶"]="https://youtube.com/playlist?list=PLMIbmfP_9vb8BCxRoraJpoo4q1yMFg4CE" - ["Youtube Remix 📻🎶"]="https://youtube.com/playlist?list=PLeqTkIUlrZXlSNn3tcXAa-zbo95j0iN-0" - ["Korean Drama OST 📻🎶"]="https://youtube.com/playlist?list=PLUge_o9AIFp4HuA-A3e3ZqENh63LuRRlQ" -) - -# Function for displaying notifications -notification() { - notify-send -u normal -i "$iDIR/music.png" "Playing now: $@" -} - -# Main function -main() { - choice=$(printf "%s\n" "${!menu_options[@]}" | rofi -dmenu -config ~/.config/rofi/config-rofi-Beats.rasi -i -p "") - - if [ -z "$choice" ]; then - exit 1 - fi - - link="${menu_options[$choice]}" - - notification "$choice" - - # Check if the link is a playlist - if [[ $link == *playlist* ]]; then - mpv --shuffle --vid=no "$link" - else - mpv "$link" - fi -} - -# Check if an online music process is running and send a notification, otherwise run the main function -pkill -f http && notify-send -u low -i "$iDIR/music.png" "Online Music stopped" || main diff --git a/config/hypr/scripts/Wallpaper.sh b/config/hypr/scripts/Wallpaper.sh deleted file mode 100755 index d75d2eab..00000000 --- a/config/hypr/scripts/Wallpaper.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -DIR="$HOME/Pictures/wallpapers" -SCRIPTSDIR="$HOME/.config/hypr/scripts" - -PICS=($(find ${DIR} -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -o -name "*.gif" \))) -RANDOMPICS=${PICS[ $RANDOM % ${#PICS[@]} ]} - - -# Transition config -FPS=60 -TYPE="random" -DURATION=1 -BEZIER=".43,1.19,1,.4" -SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER" - - -swww query || swww init && swww img ${RANDOMPICS} $SWWW_PARAMS - - -${SCRIPTSDIR}/PywalSwww.sh -sleep 1 -${SCRIPTSDIR}/Refresh.sh - diff --git a/config/hypr/scripts/WallpaperRandom.sh b/config/hypr/scripts/WallpaperRandom.sh deleted file mode 100755 index 13bd2995..00000000 --- a/config/hypr/scripts/WallpaperRandom.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# This script will randomly go through the files of a directory, setting it -# up as the wallpaper at regular intervals -# -# NOTE: this script uses bash (not POSIX shell) for the RANDOM variable - -pywal_refresh=$HOME/.config/hypr/scripts/RefreshNoWaybar.sh - -if [[ $# -lt 1 ]] || [[ ! -d $1 ]]; then - echo "Usage: - $0 " - exit 1 -fi - -# Edit below to control the images transition -export SWWW_TRANSITION_FPS=60 -export SWWW_TRANSITION_TYPE=simple - -# This controls (in seconds) when to switch to the next image -INTERVAL=1800 - -while true; do - find "$1" \ - | while read -r img; do - echo "$((RANDOM % 1000)):$img" - done \ - | sort -n | cut -d':' -f2- \ - | while read -r img; do - swww img "$img" - $pywal_refresh - sleep $INTERVAL - - done -done diff --git a/config/hypr/scripts/WallpaperSelect.sh b/config/hypr/scripts/WallpaperSelect.sh deleted file mode 100755 index 5c3f2b94..00000000 --- a/config/hypr/scripts/WallpaperSelect.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash - -SCRIPTSDIR="$HOME/.config/hypr/scripts" - -# WALLPAPERS PATH -DIR="$HOME/Pictures/wallpapers" - -# Transition config -FPS=30 -TYPE="wipe" -DURATION=1 -BEZIER=".43,1.19,1,.4" -SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION" - -# Check if swaybg is running -if pidof swaybg > /dev/null; then - pkill swaybg -fi - -# Retrieve image files -PICS=($(ls "${DIR}" | grep -E ".jpg$|.jpeg$|.png$|.gif$")) -RANDOM_PIC="${PICS[$((RANDOM % ${#PICS[@]}))]}" -RANDOM_PIC_NAME="${#PICS[@]}. random" - -# Rofi command -rofi_command="rofi -show -dmenu -config ~/.config/rofi/config-wallpaper.rasi" - -menu() { - for i in "${!PICS[@]}"; do - # Displaying .gif to indicate animated images - if [[ -z $(echo "${PICS[$i]}" | grep .gif$) ]]; then - printf "$(echo "${PICS[$i]}" | cut -d. -f1)\x00icon\x1f${DIR}/${PICS[$i]}\n" - else - printf "${PICS[$i]}\n" - fi - done - - printf "$RANDOM_PIC_NAME\n" -} - -swww query || swww init - -main() { - choice=$(menu | ${rofi_command}) - - # No choice case - if [[ -z $choice ]]; then - exit 0 - fi - - # Random choice case - if [ "$choice" = "$RANDOM_PIC_NAME" ]; then - swww img "${DIR}/${RANDOM_PIC}" $SWWW_PARAMS - exit 0 - fi - - # Find the index of the selected file - pic_index=-1 - for i in "${!PICS[@]}"; do - filename=$(basename "${PICS[$i]}") - if [[ "$filename" == "$choice"* ]]; then - pic_index=$i - break - fi - done - - if [[ $pic_index -ne -1 ]]; then - swww img "${DIR}/${PICS[$pic_index]}" $SWWW_PARAMS - else - echo "Image not found." - exit 1 - fi -} - -# Check if rofi is already running -if pidof rofi > /dev/null; then - pkill rofi - exit 0 -fi - -main - -sleep 0.5 -${SCRIPTSDIR}/PywalSwww.sh -sleep 0.2 -${SCRIPTSDIR}/Refresh.sh diff --git a/config/hypr/scripts/Wlogout.sh b/config/hypr/scripts/Wlogout.sh index 998d3fed..71d21447 100755 --- a/config/hypr/scripts/Wlogout.sh +++ b/config/hypr/scripts/Wlogout.sh @@ -1,8 +1,8 @@ #!/bin/bash # Set variables for parameters -A_2160=2500 -B_2160=2700 +A_2160=500 +B_2160=500 A_1440=500 B_1440=550 A_1080=300 @@ -24,7 +24,7 @@ echo "Detected Resolution: $resolution" # Set parameters based on screen resolution and scaling factor if ((resolution >= 2160)); then - wlogout --protocol layer-shell -b 6 -T $(awk "BEGIN {printf \"%.0f\", $A_2160 * 2160 * $hypr_scale / $resolution}") -B $(awk "BEGIN {printf \"%.0f\", $B_2160 * 2160 * $hypr_scale / $resolution}") & + wlogout --protocol layer-shell -b 3 -T $(awk "BEGIN {printf \"%.0f\", $A_2160 * 2160 * $hypr_scale / $resolution}") -B $(awk "BEGIN {printf \"%.0f\", $B_2160 * 2160 * $hypr_scale / $resolution}") & echo "Setting parameters for resolution >= 2160p" elif ((resolution >= 1440)); then wlogout --protocol layer-shell -b 6 -T $(awk "BEGIN {printf \"%.0f\", $A_1440 * 1440 * $hypr_scale / $resolution}") -B $(awk "BEGIN {printf \"%.0f\", $B_1440 * 1440 * $hypr_scale / $resolution}") & @@ -38,4 +38,4 @@ elif ((resolution > 720)); then else wlogout & echo "Setting default parameters for resolution <= 720p" -fi +fi \ No newline at end of file -- cgit v1.2.3