From 231feb4c1107f5ec80068955e57bf557299ad6d3 Mon Sep 17 00:00:00 2001 From: Breizh Date: Mon, 22 Apr 2024 16:42:01 +0200 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20Variety?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .Xresources | 2 +- .config/i3/config | 2 +- .config/ncmpcpp/config | 1 + .../{set_wallpaper => set_wallpaper_custom} | 49 ++++++++----------- 4 files changed, 23 insertions(+), 31 deletions(-) rename .config/variety/scripts/{set_wallpaper => set_wallpaper_custom} (90%) diff --git a/.Xresources b/.Xresources index 617739a..14fcf52 100644 --- a/.Xresources +++ b/.Xresources @@ -79,7 +79,7 @@ URxvt*saveLines: 0 ! for 'fake' transparency (without Compton) uncomment the following three lines URxvt*inheritPixmap: true URxvt*transparent: true -URxvt*shading: 40 +URxvt*shading: 15 !URxvt*blurRadius: 24x24 ! other possible settings: diff --git a/.config/i3/config b/.config/i3/config index 64d2e64..436cd4c 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -375,7 +375,7 @@ exec --no-startup-id sleep 1m && steam-native -silent -noverifyfiles -language f #exec --no-startup-id SVPManager #exec --no-startup-id hp-systray -x exec --no-startup-id sleep 1m && play "$HOME/Musique/WELCOME BACK.wav" -#exec --no-startup-id variety +exec --no-startup-id variety #exec --no-startup-id sleep 5m && qbittorrent # Start i3bar to display a workspace bar (plus the system information i3status if available) diff --git a/.config/ncmpcpp/config b/.config/ncmpcpp/config index b51b8c5..88be9ab 100644 --- a/.config/ncmpcpp/config +++ b/.config/ncmpcpp/config @@ -406,6 +406,7 @@ connected_message_on_startup = no #cyclic_scrolling = no # #lyrics_fetchers = azlyrics, genius, musixmatch, sing365, metrolyrics, justsomelyrics, jahlyrics, plyrics, tekstowo, zeneszoveg, internet +lyrics_fetchers = azlyrics, musixmatch, sing365, metrolyrics, justsomelyrics, jahlyrics, plyrics, tekstowo, zeneszoveg, internet # #follow_now_playing_lyrics = no # diff --git a/.config/variety/scripts/set_wallpaper b/.config/variety/scripts/set_wallpaper_custom similarity index 90% rename from .config/variety/scripts/set_wallpaper rename to .config/variety/scripts/set_wallpaper_custom index 60b283b..f001777 100755 --- a/.config/variety/scripts/set_wallpaper +++ b/.config/variety/scripts/set_wallpaper_custom @@ -126,38 +126,30 @@ fi # and KDE will refresh it # On Plasma 5.7 and above, the wallpaper choosing is automatic. if [ "${KDE_FULL_SESSION}" == "true" ]; then - # Plasma 5.7 introduced a new feature to set the wallpaper via a qdbus script: + # Plasma 5.7 introduced a new feature to set the wallpaper via a dbus script: # https://github.com/KDE/plasma-workspace/commit/903cbfd7e267a4812a6ec222eb7e1b5dd775686f - if [[ -n "${KDE_SESSION_VERSION}" && "${KDE_SESSION_VERSION}" == '5' ]]; then - - # Try to find the Qt 5 version of qdbus. For systems using qtchooser, the binary name is 'qdbus' - # and the Qt version can be selected via the QT_SELECT environment variable. - if command -v qdbus-qt5 &>/dev/null; then - qdbus_command=qdbus-qt5 - else - qdbus_command=qdbus - fi - - QT_SELECT=5 $qdbus_command org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript " - var allDesktops = desktops(); - for (i=0; i < allDesktops.length; i++) { - d = allDesktops[i]; - d.wallpaperPlugin = 'org.kde.image'; - d.currentConfigGroup = Array('Wallpaper', 'org.kde.image', 'General'); - d.writeConfig('Image', 'file://""$WP""') + plasma_qdbus_script=" + let allDesktops = desktops(); + for (let d of allDesktops) { + if (d.wallpaperPlugin == 'org.kde.image') { + d.currentConfigGroup = Array('Wallpaper', 'org.kde.image', 'General'); + d.writeConfig('Image', 'file://""$WP""'); + } } - " - # Reuse the exit code from qdbus - qdbus_exitcode="$?" + " + if [[ -n "${KDE_SESSION_VERSION}" && "${KDE_SESSION_VERSION}" -ge '5' ]]; then + dbus-send --type=method_call --dest=org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript string:"$plasma_qdbus_script" + # Reuse the exit code from dbus + dbus_exitcode="$?" - if [[ "$qdbus_exitcode" -ne 0 ]]; then + if [[ "$dbus_exitcode" -ne 0 && "${KDE_SESSION_VERSION}" -eq '5' ]]; then # If the script fails, show a notification. kdialog --title "Variety: cannot change Plasma wallpaper" --passivepopup "Could not change the Plasma 5 wallpaper; \ make sure that you're using Plasma 5.7+ and have widgets unlocked.\n----\n \ Due to Plasma limitations, external programs cannot automatically change the wallpaper when the widgets are locked.\n \ See https://git.io/vprpM for more information." --icon variety 10 # Final number is the length of the popup fi - exit "$qdbus_exitcode" + exit "$dbus_exitcode" else WALLDIR="$(xdg-user-dir PICTURES)/variety-wallpaper" @@ -225,25 +217,24 @@ fi # For simple WMs, use either feh or nitrogen # Implementation note: this uses spaces around list items to enforce matching whole words. # This also means that an empty variable won't cause false positives, since it expands to " " -SIMPLE_WMS=("bspwm" "dwm" "herbstluftwm" "i3" "i3-with-shmlog" "jwm" "LeftWM" "openbox" "qtile" "qtile-venv" "xmonad") +SIMPLE_WMS=("bspwm" "dwm" "herbstluftwm" "i3" "i3-gnome" "i3-with-shmlog" "jwm" "LeftWM" "openbox" "qtile" "qtile-venv" "spectrwm" "xmonad") if [[ " ${SIMPLE_WMS[*]} " = *" $XDG_CURRENT_DESKTOP "* || " ${SIMPLE_WMS[*]} " = *" $XDG_SESSION_DESKTOP "* || " ${SIMPLE_WMS[*]} " = *" $DESKTOP_SESSION "* ]]; then if command -v "feh" >/dev/null 2>&1; then # TODO: This should take the scaling parameter $4 into account and use other options than --bg-fill - feh --bg-fill "$WP" 2> /dev/null + feh --bg-max "$WP" 2> /dev/null elif command -v "nitrogen" >/dev/null 2>&1; then # TODO: This should take the scaling parameter $4 into account and use other options than --set-zoom-fill nitrogen --set-zoom-fill --save "$WP" 2> /dev/null fi fi - -if [[ -n $SWAYSOCK ]]; then +PID=`pidof swaybg` +if [[ -n $PID ]]; then # If swaybg is available, use it as prevents system freeze. # See https://github.com/swaywm/sway/issues/5606 if command -v "swaybg" >/dev/null 2>&1; then # Grey background flicker is prevented by killing old swaybg process after new one. # See https://github.com/swaywm/swaybg/issues/17#issuecomment-851680720 - PID=`pidof swaybg` swaybg -i "$WP" -m fill & if [ ! -z "$PID" ]; then sleep 1 @@ -283,7 +274,7 @@ fi # NOTE: This config will change the wallpaper after your current awesome theme sets it. # As such, the theme's wallpaper will briefly appear before being replaced with Variety's wallpaper. if [[ "$XDG_SESSION_DESKTOP $DESKTOP_STARTUP_ID $DESKTOP_SESSION $XDG_CURRENT_DESKTOP" == *"awesome"* ]]; then - echo "local gears = require(\"gears\") gears.wallpaper.maximized(\"$1\", nil)" | awesome-client + echo "for s in screen do require(\"gears\").wallpaper.maximized(\"$1\", s) end" | awesome-client fi # =====================================================================================