♻️ hypr: separate and organize scripts
This commit is contained in:
+2
-2
@@ -20,5 +20,5 @@ exec-once = sh $HOME/.config/hypr/scripts/night-light-check.sh
|
|||||||
exec-once = ags run --log-file $HOME/ags.log
|
exec-once = ags run --log-file $HOME/ags.log
|
||||||
|
|
||||||
# Apps
|
# Apps
|
||||||
exec-once = /usr/bin/env vesktop --start-minimized
|
exec-once = /bin/vesktop --start-minimized
|
||||||
exec-once = /usr/bin/env steam -silent
|
exec-once = /bin/steam -silent
|
||||||
|
|||||||
@@ -23,3 +23,4 @@ env = QT_QPA_PLATFORMTHEME, qt5ct
|
|||||||
env = QT_AUTO_SCREEN_SCALE_FACTOR, 1
|
env = QT_AUTO_SCREEN_SCALE_FACTOR, 1
|
||||||
env = ADW_DISABLE_PORTAL, 1
|
env = ADW_DISABLE_PORTAL, 1
|
||||||
env = MOZ_ENABLE_WAYLAND, 1
|
env = MOZ_ENABLE_WAYLAND, 1
|
||||||
|
#env = ELECTRON_OZONE_PLATFORM_HINT, auto
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
env = LIBVA_DRIVER_NAME, nvidia
|
env = LIBVA_DRIVER_NAME, nvidia
|
||||||
env = __GLX_VENDOR_LIBRARY_NAME, nvidia
|
env = __GLX_VENDOR_LIBRARY_NAME, nvidia
|
||||||
env = NVD_BACKEND, direct
|
env = NVD_BACKEND, direct
|
||||||
env = ELECTRON_OZONE_PLATFORM_HINT, auto
|
|
||||||
|
|
||||||
cursor {
|
cursor {
|
||||||
# Set to true if you have issues
|
# Set to true if you have issues
|
||||||
|
|||||||
+3
-1
@@ -46,7 +46,8 @@ layerrule = animation slide right, eww-cc
|
|||||||
layerrule = animation fade, eww-calendar
|
layerrule = animation fade, eww-calendar
|
||||||
layerrule = animation fade, eww-volume
|
layerrule = animation fade, eww-volume
|
||||||
layerrule = animation fade, eww-powermenu
|
layerrule = animation fade, eww-powermenu
|
||||||
layerrule = animation up, control-center
|
layerrule = animation fade, control-center
|
||||||
|
layerrule = animation fade, center-window # Bruh i need a better name for this :skull:
|
||||||
|
|
||||||
# Opacity
|
# Opacity
|
||||||
windowrulev2 = opacity .95 .95, class:kitty
|
windowrulev2 = opacity .95 .95, class:kitty
|
||||||
@@ -71,6 +72,7 @@ layerrule = blur, eww-powermenu
|
|||||||
layerrule = blur, top-bar
|
layerrule = blur, top-bar
|
||||||
layerrule = blur, osd
|
layerrule = blur, osd
|
||||||
layerrule = blur, control-center
|
layerrule = blur, control-center
|
||||||
|
#layerrule = blur, logout-menu
|
||||||
layerrule = ignorealpha .6, eww-volume
|
layerrule = ignorealpha .6, eww-volume
|
||||||
layerrule = ignorealpha .55, eww-bar
|
layerrule = ignorealpha .55, eww-bar
|
||||||
layerrule = ignorealpha .5, eww-calendar
|
layerrule = ignorealpha .5, eww-calendar
|
||||||
|
|||||||
@@ -1,90 +1,72 @@
|
|||||||
#!/usr/bin/env bash
|
#!usr/bin/env bash
|
||||||
|
|
||||||
|
# Prompts the user with dmenu(or dmenu-like app, see hypr/scripts/get-dmenu.sh)
|
||||||
# Prompts the user with anyrun or wofi to choose an image file inside
|
# to choose an image file inside defined $WALLPAPERS_DIR. If the user selects
|
||||||
# the defined $WALLPAPERS_DIR. If the user selects an entry, it automatically
|
# an entry, it automatically writes changes to the hyprpaper.conf file and
|
||||||
# writes changes to the hyprpaper.conf file and hot-reloads wallpaper if hyprpaper
|
# hot-reloads if hyprpaper is running.
|
||||||
# is running.
|
|
||||||
# --------------
|
# --------------
|
||||||
# Licensed under the MIT License
|
# Licensed under the MIT License
|
||||||
# Made by retrozinndev (João Dias)
|
# Made by retrozinndev (João Dias)
|
||||||
# From https://github.com/retrozinndev/Hyprland-Dots
|
# From https://github.com/retrozinndev/Hyprland-Dots
|
||||||
|
|
||||||
HYPRPAPER_FILE="$HOME/.config/hypr/hyprpaper.conf"
|
style="darken" # lighten / darken
|
||||||
COLORSCHEME_STYLE="darken" # lighten / darken
|
dmenu=$(sh "$XDG_CONFIG_HOME/hypr/scripts/get-dmenu.sh")
|
||||||
|
|
||||||
if [[ $WALLPAPERS_DIR == "" ]]; then
|
if [[ -z "$WALLPAPERS_DIR" ]]; then
|
||||||
WALLPAPERS_DIR="$HOME/wallpapers"
|
WALLPAPERS_DIR="$HOME/wallpapers"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f /bin/anyrun ]]; then
|
if [[ -z "$dmenu" ]]; then
|
||||||
WALLPAPER_SELECT_CMD="anyrun --plugins libstdin.so"
|
|
||||||
elif [[ -f /bin/wofi ]]; then
|
|
||||||
WALLPAPER_SELECT_CMD="wofi --dmenu"
|
|
||||||
else
|
|
||||||
notify-send -u normal -a "Wallpaper" "Dmenu not found" "Couldn't find anyrun or wofi for dmenu! Try installing one of these two before selecting wallpaper!"
|
notify-send -u normal -a "Wallpaper" "Dmenu not found" "Couldn't find anyrun or wofi for dmenu! Try installing one of these two before selecting wallpaper!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z $(ls -A $WALLPAPERS_DIR) ]]
|
if [[ -z $(ls -A $WALLPAPERS_DIR) ]]; then
|
||||||
then
|
|
||||||
notify-send -u normal -a "Wallpaper" "Wallpapers not found" "Couldn't find any wallpaper inside \`~/wallpapers\`, try putting an image you like in there to choose it!"
|
notify-send -u normal -a "Wallpaper" "Wallpapers not found" "Couldn't find any wallpaper inside \`~/wallpapers\`, try putting an image you like in there to choose it!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
function Write_changes() {
|
function Write_changes() {
|
||||||
echo "Writing to hyprpaper config file..."
|
echo "[LOG] Writing to hyprpaper config file"
|
||||||
|
|
||||||
echo \
|
echo \
|
||||||
'$wallpaper'" = $SET_WALLPAPER_FULL
|
'$wallpaper'" = $wall
|
||||||
|
|
||||||
splash = true
|
splash = true
|
||||||
preload = "'$wallpaper'"
|
preload = "'$wallpaper'"
|
||||||
wallpaper = , "'$wallpaper'"" | sed -e "s/^(\\[n])//g" > $HYPRPAPER_FILE
|
wallpaper = , "'$wallpaper'"" | sed -e "s/^(\\[n])//g" > $XDG_CONFIG_HOME/hypr/hyprpaper.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
Reload_wallpaper() {
|
function Reload_wallpaper() {
|
||||||
echo "Hot-reloading wallpaper..."
|
echo "[LOG] Hot-reloading wallpaper"
|
||||||
hyprctl hyprpaper unload all
|
hyprctl hyprpaper unload all
|
||||||
hyprctl hyprpaper preload "$SET_WALLPAPER_FULL"
|
hyprctl hyprpaper preload $wall
|
||||||
hyprctl hyprpaper wallpaper ", $SET_WALLPAPER_FULL"
|
hyprctl hyprpaper wallpaper ", $wall"
|
||||||
}
|
}
|
||||||
|
|
||||||
Reload_pywal() {
|
function Reload_pywal() {
|
||||||
echo "Reloading pywal colorscheme..."
|
echo "[LOG] Reloading pywal colorscheme"
|
||||||
wal -q -t --cols16 $COLORSCHEME_STYLE -i "$SET_WALLPAPER_FULL"
|
wal -q -t --cols16 $style -i "$wall"
|
||||||
}
|
}
|
||||||
|
|
||||||
Reload_eww() {
|
# Prompt wallpaper list
|
||||||
echo "Reloading Eww..."
|
wall="$WALLPAPERS_DIR/$(ls $WALLPAPERS_DIR | $dmenu)"
|
||||||
eww reload
|
|
||||||
}
|
|
||||||
|
|
||||||
# Prompt wallpapers via dmenu
|
|
||||||
SET_WALLPAPER_NAME="$(ls $WALLPAPERS_DIR | $WALLPAPER_SELECT_CMD)"
|
|
||||||
SET_WALLPAPER_FULL="$WALLPAPERS_DIR/$SET_WALLPAPER_NAME"
|
|
||||||
|
|
||||||
echo "Selected wallpaper: $SET_WALLPAPER_NAME"
|
|
||||||
|
|
||||||
# Check if input wallpaper is empty
|
# Check if input wallpaper is empty
|
||||||
if [[ $SET_WALLPAPER_NAME == "" ]] || [[ $SET_WALLPAPER_NAME == " " ]]
|
if [[ $wall == "$WALLPAPERS_DIR/" ]]; then
|
||||||
then
|
|
||||||
echo "No wallpaper has been selected by user!"
|
echo "No wallpaper has been selected by user!"
|
||||||
if [[ $RANDOM_WALLPAPER_WHEN_EMPTY == true ]]
|
if [[ $RANDOM_WALLPAPER_WHEN_EMPTY == true ]]
|
||||||
then
|
then
|
||||||
SET_WALLPAPER_NAME=$(ls $WALLPAPERS_DIR | shuf -n 1)
|
wall="$WALLPAPERS_DIR/$(ls $WALLPAPERS_DIR | shuf -n 1)"
|
||||||
echo "Selected random wallpaper from $HOME/wallpapers: $SET_WALLPAPER_NAME"
|
echo "Selected random from $WALLPAPERS_DIR: $wall"
|
||||||
SET_WALLPAPER_FULL="$WALLPAPERS_DIR/$SET_WALLPAPER_NAME"
|
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "Skipping hyprpaper changes and exiting."
|
echo "Skipping hyprpaper changes and exiting."
|
||||||
exit 1
|
exit 0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
Reload_pywal
|
Reload_pywal
|
||||||
Reload_wallpaper
|
Reload_wallpaper
|
||||||
Reload_eww
|
|
||||||
Write_changes
|
Write_changes
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
@@ -3,5 +3,5 @@
|
|||||||
selection=$(cliphist list | anyrun --plugins libstdin.so | cliphist decode)
|
selection=$(cliphist list | anyrun --plugins libstdin.so | cliphist decode)
|
||||||
|
|
||||||
if [[ ! -z "$selection" ]]; then
|
if [[ ! -z "$selection" ]]; then
|
||||||
echo -e $selection | sed -e 's/\n$//g' | wl-copy
|
printf "%s" $selection | sed -e 's/\n$//g' | wl-copy
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Checks environment for dmenu or dmenu-like apps
|
||||||
|
# and prints out a command to pipe of.
|
||||||
|
# -----------
|
||||||
|
# Licensed under the MIT License
|
||||||
|
# Made by retrozinndev (João Dias)
|
||||||
|
# From: https://github.com/retrozinndev/Hyprland-Dots
|
||||||
|
|
||||||
|
DMENUS=(
|
||||||
|
"anyrun:--plugins:libstdin.so"
|
||||||
|
"rofi:-dmenu"
|
||||||
|
"wofi:--show:dmenu"
|
||||||
|
"dmenu"
|
||||||
|
)
|
||||||
|
|
||||||
|
for dmenu in ${DMENUS[@]}; do
|
||||||
|
name=$(printf "$dmenu" | awk -F: '{ print $1 }')
|
||||||
|
cmd=$(env "$name" -h > /dev/null)
|
||||||
|
code=$?
|
||||||
|
|
||||||
|
if [[ ! $code == 127 ]]; then
|
||||||
|
echo "$dmenu" | sed 's/:/ /g'
|
||||||
|
break;
|
||||||
|
fi
|
||||||
|
done
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# This script runs notification-handler.sh script
|
|
||||||
# and handles any issues that happens with it.
|
|
||||||
# --------
|
|
||||||
# Licensed under the MIT License
|
|
||||||
# Made by retrozinndev (João Dias)
|
|
||||||
# From https://github.com/retrozinndev/Hyprland-Dots
|
|
||||||
|
|
||||||
logfile="$HOME/.cache/notification-handler-daemon.log"
|
|
||||||
handler_script="$HOME/.config/eww/scripts/notification-handler.sh"
|
|
||||||
|
|
||||||
function Send_log() {
|
|
||||||
echo "[$1]${@/$1}" >> $logfile
|
|
||||||
}
|
|
||||||
|
|
||||||
function Exit_daemon() {
|
|
||||||
Send_log "info" "Handler exited normally, quitting daemon."
|
|
||||||
exit 0
|
|
||||||
}
|
|
||||||
|
|
||||||
function Restart_handler() {
|
|
||||||
bash $handler_script &
|
|
||||||
pid_handler=$!
|
|
||||||
Send_log "info" "Handler started!"
|
|
||||||
Send_log "info" "Handler script PID: $pid_handler"
|
|
||||||
wait $pid_handler && Exit_daemon || \
|
|
||||||
(Send_log "error" "An error occurred and handler stopped"
|
|
||||||
Send_log "info" "Clearing history and starting handler again."
|
|
||||||
sh $HOME/.config/eww/scripts/notification-clear.sh &
|
|
||||||
Restart_handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
trap "Send_log 'info' 'SIGINT received, stopping daemon and handler' ; kill \$pid_handler ; exit 1" SIGINT
|
|
||||||
trap "Send_log 'info' 'SIGTERM received, stopping daemon and handler' ; kill \$pid_handler ; exit 1" SIGTERM
|
|
||||||
|
|
||||||
echo -e '' > $logfile
|
|
||||||
Send_log "info" "Starting Daemon..."
|
|
||||||
Send_log "info" "Daemon script PID: $$"
|
|
||||||
Restart_handler
|
|
||||||
Reference in New Issue
Block a user