diff --git a/.memo/hyprland-ricing b/.memo/hyprland-ricing index 14f0d27..eff3428 100644 --- a/.memo/hyprland-ricing +++ b/.memo/hyprland-ricing @@ -1,5 +1,14 @@ -things installed: +things I have installed: +full KDE Plasma 6 setup # not essential for sure + which can provide: + SDDM theme # Breeze is enough + kcalc/kalc # calculator(s) + kcolorchooser # works smoothly on hyprland + pipewire & friends + ... + +# hypr* hyprland hyprpaper hypridle @@ -8,10 +17,17 @@ hyprshot hyprlicker # kcolorchooser also works though hyprland-plugin-hyprexpo # scale workspaces and put them in a grid +# xdg-desktop-portal* +xdg-desktop-portal xdg-desktop-portal-hyprland # not working with my Intel iGPU, but fine with NVIDIA dGPU xdg-desktop-portal-gnome # not necessary maybe, but just in case xdg-desktop-portal-gtk # required by nautilus for file picker +# terminal emulator(s) +kitty # normal terminal +ghostty # floating terminal, for btop for example# + +# under surface mako # notification daemon gnome-keyring # --password-store=gnome-libsecret wl-clipboard @@ -20,32 +36,35 @@ network-manager-applet # nm-applet slurp # region selector wf-recorder # screen recorder brightnessctl +playerctl pamixer qt5ct qt6ct -spicetify # spotify tweaks -spicetify-maketplace # spotify themes +# GUI waybar eww wlogout fuzzel +mpv blueman # bluetooth GUI & applet pavucontrol nautilus # file manager and file picker +sushi # "Quicklook" for nautilus gnome-text-editor # or kwrite, just notepad replacement btop # system monitor activate-linux # :/ +polkit-gnome # polkit authentication agent +# fonts & themes maplemonol-nf-cn ttf-font-awesome -meslo font # I installed manually +meslo font # I installed it manually +spicetify # spotify tweaks +spicetify-maketplace # spotify themes nwg-look # theme of GTK apps catppuccin-gtk-theme-mocha # theme of GTK apps -polkit-gnome # polkit authentication agent - -kitty # normal terminal -ghostty # floating terminal, for btop for example# +# utils bc jq \ No newline at end of file diff --git a/.scripts/lyrics-widgets.sh b/.scripts/lyrics-widgets.sh index 061ee05..a6a0eba 100755 --- a/.scripts/lyrics-widgets.sh +++ b/.scripts/lyrics-widgets.sh @@ -10,8 +10,11 @@ if [ -z "$LYRICS" ] && [ -z "$LYRICS_SINGLE" ]; then # only lyrics is open elif [ -n "$LYRICS" ] && [ -z "$LYRICS_SINGLE" ]; then eww close lyrics - sleep 0.5 - eww open lyrics-single + # if waybar is running, open lyrics-single + if pgrep -x "waybar" > /dev/null; then + sleep 0.5 + eww open lyrics-single + fi # only lyrics-single is open elif [ -z "$LYRICS" ] && [ -n "$LYRICS_SINGLE" ]; then diff --git a/.scripts/waybar-toggle.sh b/.scripts/waybar-toggle.sh index bccfe6a..175e0fc 100755 --- a/.scripts/waybar-toggle.sh +++ b/.scripts/waybar-toggle.sh @@ -7,6 +7,11 @@ function close() { # Wait until the processes have been shut down while pgrep -x waybar >/dev/null; do sleep 1; done fi + + # Also close the lyrics widget if open + if eww active-windows | grep -q "lyrics-single"; then + eww close lyrics-single + fi } function open() { diff --git a/eww/Lyrics/eww.scss b/eww/Lyrics/eww.scss index 2d99bd1..9689511 100644 --- a/eww/Lyrics/eww.scss +++ b/eww/Lyrics/eww.scss @@ -27,7 +27,7 @@ .lyrics-box-single { margin: 5px 0px 5px 10px; - min-width: 634px; + min-width: 740px; } .lyrics-text { diff --git a/eww/Lyrics/eww.yuck b/eww/Lyrics/eww.yuck index f2dec54..aa15b60 100644 --- a/eww/Lyrics/eww.yuck +++ b/eww/Lyrics/eww.yuck @@ -3,7 +3,8 @@ (defpoll position :interval "1s" "~/.local/bin/spotify-lyrics position") (defpoll length :interval "1s" "~/.local/bin/spotify-lyrics length") (defpoll offset :interval "1s" "cat $HOME/.local/state/eww/lyrics/offset") -(defpoll play-button :interval "1s" "if ~/.local/bin/spotify-lyrics status; then echo \"󰏤\"; else echo \"󰐊\"; fi")(defvar hover false) +(defpoll play-button :interval "1s" "if ~/.local/bin/spotify-lyrics status; then echo \"󰏤\"; else echo \"󰐊\"; fi") +(defvar hover false) (defwidget lyrics [] (box :class "lyrics-window" :space-evenly "false" :orientation "v" @@ -22,7 +23,7 @@ ) (box :class "control-row-1" :space-evenly "false" :orientation "h" (button :class "offset-reset" :onclick "Lyrics/scripts/lyric-offset.py" "󰾅") - (button :class "offset-clear" :onclick "Lyrics/scripts/lyric-clear.sh" "󰑙") + (button :class "offset-clear" :onclick "Lyrics/scripts/lyric-clear.sh $(~/.local/bin/spotify-lyrics trackid)" "󰑙") ) ) ) diff --git a/eww/Lyrics/scripts/lyric-clear.sh b/eww/Lyrics/scripts/lyric-clear.sh index ff2d7a5..d52a575 100755 --- a/eww/Lyrics/scripts/lyric-clear.sh +++ b/eww/Lyrics/scripts/lyric-clear.sh @@ -1,6 +1,9 @@ #!/bin/sh -killall spotify-lyrics -sleep 0.1 -"$HOME/.local/bin/spotify-lyrics" clear -notify-send -a "spotify-lyrics" "Cache Cleared" "The lyrics cache have been cleared." \ No newline at end of file +if [ -z $1 ]; then + "$HOME/.local/bin/spotify-lyrics" clear + notify-send -a "spotify-lyrics" "Cache Cleared" "Lyrics cache have been cleared." +else + "$HOME/.local/bin/spotify-lyrics" clear "$1" + notify-send -a "spotify-lyrics" "Cache Cleared" "Lyrics cache for track $1 have been cleared." +fi \ No newline at end of file diff --git a/eww/Main/eww.scss b/eww/Main/eww.scss index e5f3254..e3ae64b 100644 --- a/eww/Main/eww.scss +++ b/eww/Main/eww.scss @@ -142,7 +142,7 @@ background-size: cover; background-repeat: no-repeat; min-width: 455px; - min-height: 200px; + min-height: 240px; border-radius: 17px; background-position: center; margin: 20px 0px 0px 20px; @@ -170,9 +170,9 @@ } .music-stuff-box { - min-height: 200px; border-radius: 15px; background: linear-gradient(to right, $bg-alt, transparent); + min-height: 240px; } .player-cover-box { @@ -213,7 +213,7 @@ .cavabar { font-size: 14px; - color: $lavender; + color: $blue; } .music-controls-box { diff --git a/eww/Main/eww.yuck b/eww/Main/eww.yuck index 7374b06..42d9d70 100644 --- a/eww/Main/eww.yuck +++ b/eww/Main/eww.yuck @@ -1,6 +1,6 @@ ;; variables (defvar window false) -(defpoll time :interval "1s" "date '+%I %M'") +(defpoll time :interval "1s" "date '+%H %M'") (defpoll date :interval "1s" "date '+%A, %B %d'") (deflisten notifications-cards "Main/scripts/logger.zsh subscribe") (defpoll notifications-crits :interval "1s" "Main/scripts/logger.zsh crits") @@ -24,6 +24,7 @@ (defpoll music-pp :interval "1s" "Main/scripts/music-title --icon") (defpoll music-artist :interval "1s" "Main/scripts/music-artist") (defpoll music-art :interval "1s" "Main/scripts/music-art") +(defpoll music-art-blur :interval "1s" "Main/scripts/music-art --blur") (defpoll volume :interval "1s" "Main/scripts/system --vol") (defpoll brightness :interval "1s" "Main/scripts/system --bri") (defpoll fortune :interval "1h" "Main/scripts/fortune-split 32 9") @@ -32,7 +33,8 @@ (defpoll artist :interval "1s" "Main/scripts/player --artist") (defpoll album :interval "1s" "Main/scripts/player --album") (defpoll length-info :interval "1s" "Main/scripts/player --length-info") -(defpoll art :interval "1s" "Main/scripts/player --cover") +(defvar volume-hover false) +(defvar brightness-hover false) ;; widgets (defwidget main [] @@ -51,10 +53,27 @@ (label :class "stats-header" :halign "start" :text "Stats") (box :class "volume-stats" :hexpand "false" :vexpand "false" :space-evenly "false" (label :tooltip "${volume}%" :class "volume-icon" :text "󰕾") - (scale :min 0 :max 101 :active false :value {volume == "" ? 0 : volume} :class "volume-scale" :width 150)) + (eventbox :class "volume-eventbox" + :onhover "eww update volume-hover=true" + :onhoverlost "eww update volume-hover=false" + :cursor "pointer" + :space-evenly "false" + (scale :min 0 :max 101 :class "volume-scale" :width 150 + :value {volume == "" ? 0 : volume} + :round-digits 0 + :onchange { volume-hover ? "wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ {}%" : "" } + ))) (box :class "brightness-stats" :hexpand "false" :vexpand "false" :space-evenly "false" (label :tooltip "${brightness}%" :class "brightness-icon" :text "󰃠") - (scale :min 0 :max 101 :active false :value {brightness == "" ? 0 : brightness} :class "brightness-scale" :width 150)) + (eventbox :class "brightness-eventbox" + :onhover "eww update brightness-hover=true" + :onhoverlost "eww update brightness-hover=false" + :cursor "pointer" + :space-evenly "false" + (scale :min 0 :max 101 :class "brightness-scale" :width 150 + :value {brightness == "" ? 0 : brightness} + :round-digits 0 + :onchange { brightness-hover ? "brightnessctl set {}\% -d $DISPLAY_DEVICE" : "" }))) (box :class "cpu-stats" :hexpand "false" :vexpand "false" :space-evenly "false" (label :tooltip "${cpu}%" :class "cpu-icon" :text "󰘚") (scale :min 0 :max 101 :active false :value {cpu == "" ? 0 : cpu} :class "cpu-scale" :width 150)) @@ -65,7 +84,7 @@ (label :class "fortune-header" :halign "start" :text "Fortune") (label :class "fortune-text" :halign "start" :text fortune :show-truncated true :wrap true))) (box :class "third-row" :orientation "h" :space-evenly "false" - (box :class "music-art-box" :space-evenly "false" :orientation "v" :hexpand "false" :vexpand "false" :style "background-image: url(\"${music-art}\");" + (box :class "music-art-box" :space-evenly "false" :orientation "v" :hexpand "false" :vexpand "false" :style "background-image: url(\"${music-art-blur}\");" (box :class "music-stuff-box" :space-evenly "false" :hexpand "false" :vexpand "false" :orientation "v" (box :class "player-box" :hexpand "false" :vexpand "false" :space-evenly "true" (box :class "player-info-box" :hexpand "false" :vexpand "false" :space-evenly "false" :orientation "v" :spacing 15 @@ -73,12 +92,10 @@ (label :class "player-info-artist" :text "󰠃 Artist: ${artist}" :halign "start" :limit-width 30 :tooltip "${artist}") (label :class "player-info-album" :text "󰀥 Album: ${album}" :halign "start" :limit-width 30 :tooltip "${album}") (label :class "player-info-length" :text "󰦚 Length: ${length-info}" :halign "start" :tooltip "${length-info}")) - (box :class "player-cover-box" :hexpand "false" :halign "end" :vexpand "false" :space-evenly "false" :style "background-image: url('${art}');")) - (box :class "cava-box" :hexpand "false" :vexpand "false" - (label :vexpand "false" :hexpand "false" :space-evenly "false" - :class "cavabar" - :text cava - )))) + (box :class "player-cover-box" :hexpand "false" :halign "end" :vexpand "false" :space-evenly "false" :style "background-image: url(\"${music-art}\");")) + (label :vexpand "true" :hexpand "false" :space-evenly "false" :valign "end" + :class "cavabar" + :text cava))) (box :class "music-controls-box" :space-evenly "true" :hexpand "true" :vexpand "false" :orientation "v" (button :class "music-previous" :halign "center" :onclick "playerctl previous" "󰒮") (button :class "music-pp" :halign "center" :onclick "playerctl play-pause" "${music-pp}") diff --git a/eww/Main/images/default-music-blur.png b/eww/Main/images/default-music-blur.png new file mode 100644 index 0000000..3a389c8 Binary files /dev/null and b/eww/Main/images/default-music-blur.png differ diff --git a/eww/Main/images/no-notifications.svg b/eww/Main/images/no-notifications.svg deleted file mode 100644 index 5f94c39..0000000 --- a/eww/Main/images/no-notifications.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/eww/Main/scripts/cava b/eww/Main/scripts/cava index 09fe389..4407b88 100755 --- a/eww/Main/scripts/cava +++ b/eww/Main/scripts/cava @@ -23,7 +23,7 @@ mkfifo $pipe config_file="/tmp/waybar_cava_config" echo " [general] -bars = 33 +bars = 31 [output] method = raw raw_target = $pipe diff --git a/eww/Main/scripts/music-art b/eww/Main/scripts/music-art index 0f4e609..827dcfd 100755 --- a/eww/Main/scripts/music-art +++ b/eww/Main/scripts/music-art @@ -1,8 +1,11 @@ #!/bin/bash tmp_dir="$HOME/.config/eww/Main/images" -tmp_cover_path=$tmp_dir/cover.png tmp_temp_path=$tmp_dir/temp.png +tmp_blur_path="$tmp_dir/temp-blur.png" +cache_path="$tmp_dir/temp.txt" +default_path="$tmp_dir/default-music.svg" +default_blur_path="$tmp_dir/default-music-blur.png" if [ ! -d $tmp_dir ]; then mkdir -p $tmp_dir @@ -10,13 +13,34 @@ fi artlink="$(playerctl -p spotify,$any,mpd,firefox,chromium,brave metadata mpris:artUrl | sed -e 's/open.spotify.com/i.scdn.co/g')" artFromBrowser=$(playerctl metadata mpris:artUrl | sed 's/file:\/\///g') +cached=$(cat $cache_path 2>/dev/null) if [ $(playerctl -p spotify,%any,firefox,chromium,brave,mpd metadata mpris:artUrl) ]; then - curl -s "$artlink" --output $tmp_temp_path - echo $tmp_temp_path + # avoid unnecessary downloads + if [[ $cached != $artlink ]]; then + echo $artlink > $cache_path + curl -s "$artlink" --output $tmp_temp_path + outputUrl=$tmp_temp_path + magick $tmp_temp_path -blur 0x8 $tmp_blur_path + else + outputUrl=$cached + fi elif [[ -n $artFromBrowser ]]; then - cp $artFromBrowser $tmp_temp_path - echo $tmp_temp_path + if [[ §cached != $artFromBrowser ]]; then + echo $artFromBrowser > $cache_path + cp $artFromBrowser $tmp_temp_path + magick $tmp_temp_path -blur 0x8 $tmp_blur_path + outputUrl=$tmp_temp_path + else + outputUrl=$cached + fi else - echo Main/images/default-music.svg + outputUrl=$default_path + tmp_blur_path=$default_blur_path +fi + +if [[ $1 == "--blur" ]]; then + echo $tmp_blur_path +else + echo $outputUrl fi \ No newline at end of file diff --git a/eww/Main/scripts/system b/eww/Main/scripts/system index ff6e73a..3a9ba86 100755 --- a/eww/Main/scripts/system +++ b/eww/Main/scripts/system @@ -51,7 +51,11 @@ get_vol() { ## Get Brightness get_brightness() { - brightnessctl i --machine-readable -d intel_backlight | tr ',' ' ' | awk '{print $4}' | tr -d '%' + if [ -z "$DISPLAY_DEVICE" ]; then + brightnessctl i --machine-readable | tr ',' ' ' | awk '{print $4}' | tr -d '%' + else + brightnessctl i -d $DISPLAY_DEVICE --machine-readable | tr ',' ' ' | awk '{print $4}' | tr -d '%' + fi } ## Execute accordingly diff --git a/hypr/hyprland/env.conf b/hypr/hyprland/env.conf index df25458..2ef8930 100755 --- a/hypr/hyprland/env.conf +++ b/hypr/hyprland/env.conf @@ -9,7 +9,7 @@ env = INPUT_METHOD, fcitx # ############ Themes ############# env = QT_QPA_PLATFORM, wayland -env = QT_QPA_PLATFORMTHEME, qt5ct +env = QT_QPA_PLATFORMTHEME, qt6ct env = QT_STYLE_OVERRIDE, kvantum # env = WLR_NO_HARDWARE_CURSORS, 1 @@ -24,3 +24,4 @@ env = NVD_BACKEND,direct env = XCURSOR_SIZE,24 env = HYPRCURSOR_SIZE,24 env = ELECTRON_OZONE_PLATFORM_HINT,auto +env = DISPLAY_DEVICE,intel_backlight # or nvidia_0 \ No newline at end of file diff --git a/hypr/hyprland/keybinds.conf b/hypr/hyprland/keybinds.conf index 5ee04ef..8737d6e 100755 --- a/hypr/hyprland/keybinds.conf +++ b/hypr/hyprland/keybinds.conf @@ -8,16 +8,18 @@ bind = Super, E, exec, nautilus --new-window # Launch Dolphin (file manager) bind = Super, W, exec, firefox --new-window # Launch Firefox bind = Super, X, exec, gnome-text-editor --new-window # Launch GNOME Text Editor bind = Super, B, exec, killall btop || ghostty -e btop # Launch btop (system monitor) -bind = Ctrl+Super, V, exec, pavucontrol # Launch pavucontrol (volume mixer) -bind = Ctrl+Super+Shift, V, exec, easyeffects # Launch EasyEffects (equalizer & other audio effects) +bind = Super, Space, exec, eww open main --toggle # Launch dashboard (eww) +bind = Super+Shift, V, exec, pavucontrol # Launch pavucontrol (volume mixer) +bind = Super+Shift, K, exec, waybar-toggle.sh close || waybar-toggle.sh open # Toggle waybar +bind = Super+Shift, L, exec, ~/.scripts/lyrics-widgets.sh # Toggle lyrics player #! ##! Essentials bind = Super, T, exec, kitty # Launch kitty (terminal) bind = Super, Return, exec, kitty # [hidden] bind = Super+Shift, Return, exec, ghostty # [hidden] -bind = Super, Super_L, exec, eww open main --toggle # Launch dashboard (eww) bind = Alt, Space, exec, pkill fuzzel || fuzzel # [hidden] Launch fuzzel (app launcher) +bind = Super, Super_L, exec, pkill fuzzel || fuzzel # [hidden] Launch fuzzel (app launcher) # bind = , mouse:276, exec, pkill fuzzel || fuzzel # [hidden] Launch fuzzel (app launcher) bind = Super, R, exec, pkill fuzzel || fuzzel -d -l 0 | xargs -r -I{} bash -c '{}' # Launch fuzzel (command launcher) @@ -26,8 +28,9 @@ bind = Super, R, exec, pkill fuzzel || fuzzel -d -l 0 | xargs -r -I{} bash -c '{ bind = Super, V, exec, pkill fuzzel || cliphist list | fuzzel --match-mode fzf --dmenu | cliphist decode | wl-copy # Clipboard history >> clipboard bind = Super, Period, exec, pkill fuzzel || ~/.scripts/fuzzel-emoji # Pick emoji >> clipboard bind = Ctrl+Alt, Delete, exec, pkill wlogout || wlogout -p layer-shell # [hidden] -bind = Super+Shift, S, exec, hyprshot -m region # Screen snip -bind = , Print, exec, hyprshot -m region # Screen snip +bind = Super+Shift, S, exec, hyprshot -z -m region # Screen snip +bind = Super+Ctrl+Shift, S, exec, hyprshot -z -m window # Screen snip (window) +bind = , Print, exec, hyprshot -z -m output -s -m eDP-2 # Screen snip (whole screen) # Color picker bind = Super+Shift, C, exec, hyprpicker -a # Pick color (Hex) >> clipboard # Fullscreen screenshot @@ -61,12 +64,12 @@ bindl= ,XF86AudioPause, exec, playerctl play-pause # [hidden] #! ##! Sound & Brightness bindl = ,XF86AudioMute, exec, pamixer --toggle-mute # [hidden] -bindl = Super+Shift,M, exec, pamixer --toggle-mute # [hidden] +bindl = Super+Shift, M, exec, pamixer --toggle-mute # [hidden] bindle=, XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+ && wp-vol # [hidden] bindle=, XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- && wp-vol # [hidden] -bindle=, XF86MonBrightnessUp, exec, brightnessctl -d intel_backlight set 5%+ # [hidden] -bindle=, XF86MonBrightnessDown, exec, brightnessctl -d intel_backlight set 5%- # [hidden] +bindle=, XF86MonBrightnessUp, exec, brightnessctl -d $DISPLAY_DEVICE set 5%+ # [hidden] +bindle=, XF86MonBrightnessDown, exec, brightnessctl -d $DISPLAY_DEVICE set 5%- # [hidden] #! ##! Window management @@ -157,10 +160,8 @@ bind = Super+Alt, Page_Down, movetoworkspace, +1 # [hidden] bind = Super+Alt, Page_Up, movetoworkspace, -1 # [hidden] bind = Super+Shift, Page_Down, movetoworkspace, +1 # [hidden] bind = Super+Shift, Page_Up, movetoworkspace, -1 # [hidden] -bind = Super+Alt, S, movetoworkspace, special:s +bind = Super+Alt, S, movetoworkspacesilent, special:s bind = Super, P, pin bind = Alt, Tab, cyclenext bind = Super, Tab, hyprexpo:expo, toggle # can be: toggle, select, off/disable or on/enable bind = Super+Ctrl, T, exec, ~/.scripts/workspace-new.sh # Create new workspace -bind = Super+Shift, K, exec, waybar-toggle.sh close || waybar-toggle.sh open # Toggle waybar visibility -bind = Super+Shift, L, exec, ~/.scripts/lyrics-widgets.sh # Toggle waybar visibility diff --git a/hypr/hyprland/rules.conf b/hypr/hyprland/rules.conf index ddfd813..397d562 100755 --- a/hypr/hyprland/rules.conf +++ b/hypr/hyprland/rules.conf @@ -26,6 +26,7 @@ windowrulev2 = float, class:^(Waydroid)$ windowrulev2 = float, class:^(org.kde.kcalc)$ windowrulev2 = float, class:^(org.kde.kalk)$ windowrulev2 = float, class:^(org.gnome.NautilusPreviewer)$ # Sushi in Nautilus +windowrulev2 = float, class:^(coin)$ # Picture-in-Picture windowrulev2 = float, title:^([Pp]icture[-\s]?[Ii]n[-\s]?[Pp]icture)(.*)$ diff --git a/hypr/hyprpaper.conf b/hypr/hyprpaper.conf index 3baeaa9..5d6cb19 100644 --- a/hypr/hyprpaper.conf +++ b/hypr/hyprpaper.conf @@ -1,2 +1,2 @@ -preload = /home/kolkas/config/backgrounds/arona_desks.jpg +preload = /home/kolkas/.config/backgrounds/arona_desks.jpg wallpaper = , /home/kolkas/.config/backgrounds/arona_desks.jpg diff --git a/waybar/config.jsonc b/waybar/config.jsonc index ffbf82e..b9127bd 100644 --- a/waybar/config.jsonc +++ b/waybar/config.jsonc @@ -182,14 +182,14 @@ "min-length": 7 }, "backlight": { - "device": "intel_backlight", + "device": "$DISPLAY_DEVICE", "format": "{icon} {percent}%", "format-alt": "{percent}% {icon}", "format-alt-click": "click-right", //"format-icons": ["", ""], "format-icons": [""], - "on-scroll-down": "brightnessctl -d intel_backlight set 5%-", - "on-scroll-up": "brightnessctl -d intel_backlight set +5%", + "on-scroll-down": "brightnessctl -d $DISPLAY_DEVICE set 5%-", + "on-scroll-up": "brightnessctl -d $DISPLAY_DEVICE set +5%", "max-length": 7, "min-length": 7 },