diff --git a/hypr/autostart.conf b/hypr/autostart.conf index af6780a..70e9468 100644 --- a/hypr/autostart.conf +++ b/hypr/autostart.conf @@ -3,19 +3,25 @@ ## AUTOSTART ## ############### -exec-once = systemctl enable --user --now hyprpolkitagent.service # Hyprland Policy Kit -exec-once = hyprpaper # Wallpaper -exec-once = mako # Notification Daemon -exec-once = eww daemon --no-daemonize # Eww service -exec-once = sh $HOME/.config/eww/scripts/eww-window.sh open bar -exec-once = hypridle # Idle daemon +# Services/Daemons +exec-once = systemctl enable --user --now hyprpolkitagent.service +exec-once = mako +exec-once = eww daemon --no-daemonize +exec-once = hypridle +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 -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 = //')" +# Tools +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 exec-once = /bin/vesktop --start-minimized diff --git a/hypr/bindings.conf b/hypr/bindings.conf index 0a9b240..55bedc6 100644 --- a/hypr/bindings.conf +++ b/hypr/bindings.conf @@ -13,7 +13,7 @@ $lockscreen = hyprlock $screenshotDir = $HOME/Screenshots $screenshotFull = hyprshot -m output -o $screenshotDir $screenshotSelect = hyprshot -m region -o $screenshotDir -$media = spotify-launcher +$media = amberol # 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, F11, fullscreen -# Media keys +# XF86 keys bind = , XF86AudioMedia, exec, $media bind = , XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- # Decrease volume bind = , XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ # Increase volume diff --git a/hypr/decorations.conf b/hypr/decorations.conf index ebf4642..77f6d69 100644 --- a/hypr/decorations.conf +++ b/hypr/decorations.conf @@ -23,6 +23,10 @@ general { layout = dwindle } +#render { +# ctm_animation = 1 +#} + misc { animate_manual_resizes = false } @@ -45,9 +49,12 @@ decoration { blur { enabled = true new_optimizations = true - size = 4 + xray = false # Setting to true can cause issues with nvidia cards! + size = 2 passes = 5 vibrancy = 0.9 + popups = true + popups_ignorealpha = 0.5 } } diff --git a/hypr/environment.conf b/hypr/environment.conf index 6db6d58..f940399 100644 --- a/hypr/environment.conf +++ b/hypr/environment.conf @@ -3,15 +3,23 @@ ## 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_SIZE, 24 env = HYPRCURSOR_THEME, Adwaita env = HYPRCURSOR_SIZE, 24 + +# Others env = QT_QPA_PLATFORM, wayland env = QT_QPA_PLATFORMTHEME, qt5ct env = QT_AUTO_SCREEN_SCALE_FACTOR, 1 -env = XDG_CURRENT_DESKTOP, Hyprland -env = XDG_SESSION_TYPE, wayland env = ADW_DISABLE_PORTAL, 1 env = MOZ_ENABLE_WAYLAND, 1 diff --git a/hypr/hyprlock.conf b/hypr/hyprlock.conf index 80fffb7..052c1e5 100644 --- a/hypr/hyprlock.conf +++ b/hypr/hyprlock.conf @@ -60,6 +60,18 @@ label { 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 image { monitor = diff --git a/hypr/rules.conf b/hypr/rules.conf index e257fe2..dc8fd22 100644 --- a/hypr/rules.conf +++ b/hypr/rules.conf @@ -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 windowrulev2 = float, class:moe.launcher.* @@ -40,6 +42,7 @@ layerrule = animation fade, waybar layerrule = animation fade, hyprpaper layerrule = animation slide right, swaync-notification-window layerrule = animation fade, hyprpicker +layerrule = animation fade, anyrun layerrule = animation fade, eww-calendar layerrule = animation fade, eww-volume layerrule = animation fade, eww-powermenu @@ -50,7 +53,7 @@ windowrulev2 = opacity .88 .88, class:spotify windowrulev2 = opacity .88 .88, class:hyprpolkitagent # No blur -windowrulev2 = noblur, class:^()$, title:^()$ +windowrulev2 = noblur, class:^()$, title:^()$ # Removes blur from context menus windowrulev2 = noblur, class:steam(.*)$ # Window Blur list @@ -70,8 +73,8 @@ layerrule = ignorealpha .5, eww-calendar layerrule = ignorealpha .7, eww-cc # Workspace Rules -workspace = 1, persistent:true -workspace = 2, persistent:true +#workspace = 1, persistent:true +#workspace = 2, persistent:true # Suppress maximize event from windows windowrulev2 = suppressevent maximize, class:.* diff --git a/hypr/scripts/change-wallpaper.sh b/hypr/scripts/change-wallpaper.sh index a4c2335..06c8b4d 100644 --- a/hypr/scripts/change-wallpaper.sh +++ b/hypr/scripts/change-wallpaper.sh @@ -1,58 +1,58 @@ #!/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 # writes changes to the hyprpaper.conf file and hot-reloads wallpaper if hyprpaper # 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 WALLPAPERS_DIR="$HOME/wallpapers" fi -HYPRPAPER_FILE="$HOME/.config/hypr/hyprpaper.conf" - if [[ -f /bin/anyrun ]]; then WALLPAPER_SELECT_CMD="anyrun --plugins libstdin.so" elif [[ -f /bin/wofi ]]; then WALLPAPER_SELECT_CMD="wofi --dmenu" 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 fi if [[ -z $(ls -A $WALLPAPERS_DIR) ]] 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 fi -Update_wallpaper_settings() { - echo "Writing to hyprpaper config file" +function Write_changes() { + echo "Writing to hyprpaper config file..." - echo "" > $HYPRPAPER_FILE # Cleans Hyprpaper conf + echo \ +'$wallpaper'" = $SET_WALLPAPER_FULL - echo "\$wallpaper = $SET_WALLPAPER_FULL" >> $HYPRPAPER_FILE - echo "" >> $HYPRPAPER_FILE - echo "splash = true" >> $HYPRPAPER_FILE - echo "preload = \$wallpaper" >> $HYPRPAPER_FILE - echo "wallpaper = , \$wallpaper" >> $HYPRPAPER_FILE +splash = true +preload = "'$wallpaper'" +wallpaper = , "'$wallpaper'"" | sed -e "s/^(\\[n])//g" > $HYPRPAPER_FILE } -Hot_reload_wallpaper() { - echo "Hot-reloading wallpaper" +Reload_wallpaper() { + echo "Hot-reloading wallpaper..." hyprctl hyprpaper unload all hyprctl hyprpaper preload "$SET_WALLPAPER_FULL" hyprctl hyprpaper wallpaper ", $SET_WALLPAPER_FULL" } Reload_pywal() { - echo "Reloading pywal colorscheme" - wal -q -t --cols16 darken -i "$SET_WALLPAPER_FULL" + echo "Reloading pywal colorscheme..." + wal -q -t --cols16 $COLORSCHEME_STYLE -i "$SET_WALLPAPER_FULL" } Reload_eww() { @@ -64,7 +64,7 @@ Reload_eww() { SET_WALLPAPER_NAME="$(ls $WALLPAPERS_DIR | $WALLPAPER_SELECT_CMD)" 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 if [[ $SET_WALLPAPER_NAME == "" ]] || [[ $SET_WALLPAPER_NAME == " " ]] @@ -82,9 +82,9 @@ then fi fi -Hot_reload_wallpaper Reload_pywal +Reload_wallpaper Reload_eww -Update_wallpaper_settings +Write_changes exit 0 diff --git a/hypr/scripts/gen-pywal.sh b/hypr/scripts/gen-pywal.sh new file mode 100644 index 0000000..1e45e06 --- /dev/null +++ b/hypr/scripts/gen-pywal.sh @@ -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 diff --git a/hypr/scripts/night-light-check.sh b/hypr/scripts/night-light-check.sh new file mode 100644 index 0000000..31a226c --- /dev/null +++ b/hypr/scripts/night-light-check.sh @@ -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 diff --git a/hypr/scripts/notification-handler-daemon.sh b/hypr/scripts/notification-handler-daemon.sh new file mode 100644 index 0000000..10c0152 --- /dev/null +++ b/hypr/scripts/notification-handler-daemon.sh @@ -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 diff --git a/hypr/scripts/volume-popup.sh b/hypr/scripts/volume-popup.sh new file mode 100644 index 0000000..555f8b0 --- /dev/null +++ b/hypr/scripts/volume-popup.sh @@ -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 + +