hypr(env,scripts,autostart, hyprlock): add new notification system, add media to hyprlock, organize scripts, add xdg env vars, use less blur size

This commit is contained in:
retrozinndev
2025-01-07 16:46:46 -03:00
parent c505ecf4cf
commit 89ec22cb48
11 changed files with 167 additions and 48 deletions
+17 -11
View File
@@ -3,19 +3,25 @@
## AUTOSTART ## ## AUTOSTART ##
############### ###############
exec-once = systemctl enable --user --now hyprpolkitagent.service # Hyprland Policy Kit # Services/Daemons
exec-once = hyprpaper # Wallpaper exec-once = systemctl enable --user --now hyprpolkitagent.service
exec-once = mako # Notification Daemon exec-once = mako
exec-once = eww daemon --no-daemonize # Eww service exec-once = eww daemon --no-daemonize
exec-once = sh $HOME/.config/eww/scripts/eww-window.sh open bar exec-once = hypridle
exec-once = hypridle # Idle daemon exec-once = wl-paste --type text --watch cliphist store
exec-once = wl-paste --type image --watch cliphist store
# Load pywal from cache || generate pywal colorscheme # Tools
exec-once = sh -c "[[ -d $HOME/.cache/wal ]] && wal -R || wal -q -t --cols16 darken -i $(cat '$HOME/.config/hypr/hyprpaper.conf' | grep '$wallpaper =' | sed -e 's/^$wallpaper = //')" exec-once = hyprpaper
# Scripts
exec-once = sh $HOME/.config/hypr/scripts/gen-pywal.sh
exec-once = sh $HOME/.config/hypr/scripts/night-light-check.sh
exec-once = sh $HOME/.config/hypr/scripts/notification-handler-daemon.sh
# Widgets
exec-once = sh "$(eww get EWW_CONFIG_DIR)/scripts/eww-window.sh" open bar
# Clipboard manager
exec-once = wl-paste --type text --watch cliphist store # Stores text
exec-once = wl-paste --type image --watch cliphist store # Stores images
# Apps # Apps
exec-once = /bin/vesktop --start-minimized exec-once = /bin/vesktop --start-minimized
+2 -2
View File
@@ -13,7 +13,7 @@ $lockscreen = hyprlock
$screenshotDir = $HOME/Screenshots $screenshotDir = $HOME/Screenshots
$screenshotFull = hyprshot -m output -o $screenshotDir $screenshotFull = hyprshot -m output -o $screenshotDir
$screenshotSelect = hyprshot -m region -o $screenshotDir $screenshotSelect = hyprshot -m region -o $screenshotDir
$media = spotify-launcher $media = amberol
# Main binds, see https://wiki.hyprland.org/Configuring/Binds/ for more # Main binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
@@ -28,7 +28,7 @@ bind = $mainMod, N, exec, sh $HOME/.config/eww/scripts/eww-window.sh toggle cont
bind = $mainMod, L, exec, $lockscreen bind = $mainMod, L, exec, $lockscreen
bind = $mainMod, F11, fullscreen bind = $mainMod, F11, fullscreen
# Media keys # XF86 keys
bind = , XF86AudioMedia, exec, $media bind = , XF86AudioMedia, exec, $media
bind = , XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- # Decrease volume bind = , XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- # Decrease volume
bind = , XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ # Increase volume bind = , XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ # Increase volume
+8 -1
View File
@@ -23,6 +23,10 @@ general {
layout = dwindle layout = dwindle
} }
#render {
# ctm_animation = 1
#}
misc { misc {
animate_manual_resizes = false animate_manual_resizes = false
} }
@@ -45,9 +49,12 @@ decoration {
blur { blur {
enabled = true enabled = true
new_optimizations = true new_optimizations = true
size = 4 xray = false # Setting to true can cause issues with nvidia cards!
size = 2
passes = 5 passes = 5
vibrancy = 0.9 vibrancy = 0.9
popups = true
popups_ignorealpha = 0.5
} }
} }
+11 -3
View File
@@ -3,15 +3,23 @@
## ENVIRONMENT ## ## ENVIRONMENT ##
################# #################
# Others # XDG Vars
env = XDG_CONFIG_HOME, $HOME/.config
env = XDG_CACHE_HOME, $HOME/.cache
env = XDG_DATA_HOME, $HOME/.local/share
env = XDG_STATE_HOME, $HOME/.local/state
env = XDG_CURRENT_DESKTOP, Hyprland
env = XDG_SESSION_TYPE, wayland
# Cursor
env = XCURSOR_THEME, Adwaita env = XCURSOR_THEME, Adwaita
env = XCURSOR_SIZE, 24 env = XCURSOR_SIZE, 24
env = HYPRCURSOR_THEME, Adwaita env = HYPRCURSOR_THEME, Adwaita
env = HYPRCURSOR_SIZE, 24 env = HYPRCURSOR_SIZE, 24
# Others
env = QT_QPA_PLATFORM, wayland env = QT_QPA_PLATFORM, wayland
env = QT_QPA_PLATFORMTHEME, qt5ct env = QT_QPA_PLATFORMTHEME, qt5ct
env = QT_AUTO_SCREEN_SCALE_FACTOR, 1 env = QT_AUTO_SCREEN_SCALE_FACTOR, 1
env = XDG_CURRENT_DESKTOP, Hyprland
env = XDG_SESSION_TYPE, wayland
env = ADW_DISABLE_PORTAL, 1 env = ADW_DISABLE_PORTAL, 1
env = MOZ_ENABLE_WAYLAND, 1 env = MOZ_ENABLE_WAYLAND, 1
+12
View File
@@ -60,6 +60,18 @@ label {
position = 0, 5 position = 0, 5
} }
# Media
label {
monitor =
font_size = 12
font_family = Cantarell
color = $foreground
text = cmd[update:1000] echo -e "$([[ $(eww get json_media | jq '.player') == '' ]] && echo '' || echo -e $([[ $(eww get json_media | jq '.player') =~ 'spotify' ]] && echo -e '󰓇' || echo -e '󰎇') $(eww get json_media | jq -c '.title' | xargs) - $(eww get json_media | jq -c '.artist' | xargs) '')"
halign = center
valign = center
position = 0, 180
}
# Avatar # Avatar
image { image {
monitor = monitor =
+10 -7
View File
@@ -1,9 +1,11 @@
############################ #############
## WINDOW / LAYER RULES ## ## RULES ##
############################ #############
# See https://wiki.hyprland.org/Configuring/Window-Rules/ and https://wiki.hyprland.org/Configuring/Workspace-Rules/ for information on how to configure this # See https://wiki.hyprland.org/Configuring/Window-Rules/
# and https://wiki.hyprland.org/Configuring/Workspace-Rules/
# for information on how to configure this
# Floating windows # Floating windows
windowrulev2 = float, class:moe.launcher.* windowrulev2 = float, class:moe.launcher.*
@@ -40,6 +42,7 @@ layerrule = animation fade, waybar
layerrule = animation fade, hyprpaper layerrule = animation fade, hyprpaper
layerrule = animation slide right, swaync-notification-window layerrule = animation slide right, swaync-notification-window
layerrule = animation fade, hyprpicker layerrule = animation fade, hyprpicker
layerrule = animation fade, anyrun
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
@@ -50,7 +53,7 @@ windowrulev2 = opacity .88 .88, class:spotify
windowrulev2 = opacity .88 .88, class:hyprpolkitagent windowrulev2 = opacity .88 .88, class:hyprpolkitagent
# No blur # No blur
windowrulev2 = noblur, class:^()$, title:^()$ windowrulev2 = noblur, class:^()$, title:^()$ # Removes blur from context menus
windowrulev2 = noblur, class:steam(.*)$ windowrulev2 = noblur, class:steam(.*)$
# Window Blur list # Window Blur list
@@ -70,8 +73,8 @@ layerrule = ignorealpha .5, eww-calendar
layerrule = ignorealpha .7, eww-cc layerrule = ignorealpha .7, eww-cc
# Workspace Rules # Workspace Rules
workspace = 1, persistent:true #workspace = 1, persistent:true
workspace = 2, persistent:true #workspace = 2, persistent:true
# Suppress maximize event from windows # Suppress maximize event from windows
windowrulev2 = suppressevent maximize, class:.* windowrulev2 = suppressevent maximize, class:.*
+24 -24
View File
@@ -1,58 +1,58 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# This script is made by retrozinndev (João Dias), It is licensed under
# the MIT License as in retrozinndev/Hyprland-Dots repository.
# GitHub: https://github.com/retrozinndev
# Dotfiles: https://github.com/retrozinndev/Hyprland-Dots
# The script prompts the user with anyrun or wofi to choose an image file inside # Prompts the user with anyrun or wofi to choose an image file inside
# the defined $WALLPAPERS_DIR. If the user selects an entry, it automatically # the defined $WALLPAPERS_DIR. If the user selects an entry, it automatically
# writes changes to the hyprpaper.conf file and hot-reloads wallpaper if hyprpaper # writes changes to the hyprpaper.conf file and hot-reloads wallpaper if hyprpaper
# is running. # is running.
# --------------
# Licensed under the MIT License
# Made by retrozinndev (João Dias)
# From https://github.com/retrozinndev/Hyprland-Dots
HYPRPAPER_FILE="$HOME/.config/hypr/hyprpaper.conf"
COLORSCHEME_STYLE="darken" # lighten / darken
if [[ $WALLPAPERS_DIR == "" ]]; then if [[ $WALLPAPERS_DIR == "" ]]; then
WALLPAPERS_DIR="$HOME/wallpapers" WALLPAPERS_DIR="$HOME/wallpapers"
fi fi
HYPRPAPER_FILE="$HOME/.config/hypr/hyprpaper.conf"
if [[ -f /bin/anyrun ]]; then if [[ -f /bin/anyrun ]]; then
WALLPAPER_SELECT_CMD="anyrun --plugins libstdin.so" WALLPAPER_SELECT_CMD="anyrun --plugins libstdin.so"
elif [[ -f /bin/wofi ]]; then elif [[ -f /bin/wofi ]]; then
WALLPAPER_SELECT_CMD="wofi --dmenu" WALLPAPER_SELECT_CMD="wofi --dmenu"
else else
notify-send -u normal "Hyprpaper script" "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 "Hyprpaper script" "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
Update_wallpaper_settings() { function Write_changes() {
echo "Writing to hyprpaper config file" echo "Writing to hyprpaper config file..."
echo "" > $HYPRPAPER_FILE # Cleans Hyprpaper conf echo \
'$wallpaper'" = $SET_WALLPAPER_FULL
echo "\$wallpaper = $SET_WALLPAPER_FULL" >> $HYPRPAPER_FILE splash = true
echo "" >> $HYPRPAPER_FILE preload = "'$wallpaper'"
echo "splash = true" >> $HYPRPAPER_FILE wallpaper = , "'$wallpaper'"" | sed -e "s/^(\\[n])//g" > $HYPRPAPER_FILE
echo "preload = \$wallpaper" >> $HYPRPAPER_FILE
echo "wallpaper = , \$wallpaper" >> $HYPRPAPER_FILE
} }
Hot_reload_wallpaper() { Reload_wallpaper() {
echo "Hot-reloading wallpaper" echo "Hot-reloading wallpaper..."
hyprctl hyprpaper unload all hyprctl hyprpaper unload all
hyprctl hyprpaper preload "$SET_WALLPAPER_FULL" hyprctl hyprpaper preload "$SET_WALLPAPER_FULL"
hyprctl hyprpaper wallpaper ", $SET_WALLPAPER_FULL" hyprctl hyprpaper wallpaper ", $SET_WALLPAPER_FULL"
} }
Reload_pywal() { Reload_pywal() {
echo "Reloading pywal colorscheme" echo "Reloading pywal colorscheme..."
wal -q -t --cols16 darken -i "$SET_WALLPAPER_FULL" wal -q -t --cols16 $COLORSCHEME_STYLE -i "$SET_WALLPAPER_FULL"
} }
Reload_eww() { Reload_eww() {
@@ -64,7 +64,7 @@ Reload_eww() {
SET_WALLPAPER_NAME="$(ls $WALLPAPERS_DIR | $WALLPAPER_SELECT_CMD)" SET_WALLPAPER_NAME="$(ls $WALLPAPERS_DIR | $WALLPAPER_SELECT_CMD)"
SET_WALLPAPER_FULL="$WALLPAPERS_DIR/$SET_WALLPAPER_NAME" SET_WALLPAPER_FULL="$WALLPAPERS_DIR/$SET_WALLPAPER_NAME"
echo "Wallpaper: $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 [[ $SET_WALLPAPER_NAME == "" ]] || [[ $SET_WALLPAPER_NAME == " " ]]
@@ -82,9 +82,9 @@ then
fi fi
fi fi
Hot_reload_wallpaper
Reload_pywal Reload_pywal
Reload_wallpaper
Reload_eww Reload_eww
Update_wallpaper_settings Write_changes
exit 0 exit 0
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
# This script loads/generate color schemes from current
# wallpaper using pywal16.
# ----------
# Licensed under the MIT License
# Made by retrozinndev (João Dias)
# From https://github.com/retrozinndev/Hyprland-Dots
wallpaper="$(cat $HOME'/.config/hypr/hyprpaper.conf' | grep '$wallpaper =' | sed -e 's/^$wallpaper = //')"
if ! [[ -f "$wallpaper" ]]; then
notify-send -a "Wallpaper" "Couldn't load" "Wallpaper file not found! Please check for the wallpaper: $wallpaper."
exit 1
fi
if [[ -d "$HOME/.cache/wal" ]]; then
wal -R
else
wal -q -t --cols16 darken -i "$wallpaper"
fi
+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
# This script checks if night light was enabled last
# boot, and runs hyprsunset if that's the case.
# ---------
# Licensed under the MIT License
# Made by retrozinndev (João Dias)
# From https://github.com/retrozinndev/Hyprland-Dots
if [[ -f "$HOME/.cache/night-light.pid" ]]; then
rm "$HOME/.cache/night-light.pid"
sh $HOME/.config/eww/scripts/night-light.sh
fi
@@ -0,0 +1,39 @@
#!/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
eww_config_dir=$(eww get EWW_CONFIG_DIR)
logfile="$HOME/.cache/notification-handler-daemon.log"
function Send_log() {
echo "[$1]${@/$1}" >> $logfile
}
function Exit_daemon() {
Send_log "info" "Handler exited normally, quitting daemon."
exit 0
}
function Restart_handler() {
sh $eww_config_dir/scripts/notification-handler.sh &
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."
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 '' > $logfile
Send_log "info" "Starting Daemon..."
Send_log "info" "Daemon script PID: $$"
Restart_handler
+9
View File
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
# This script triggers the Eww Volume Popup Window
# ---------
# Licensed under the MIT License
# Made by retrozinndev (João Dias)
# From https://github.com/retrozinndev/Hyprland-Dots