Ci-dessous, les différences entre deux révisions de la page.
— |
welcome:fedora:wallpapers_on_desktop [2020/02/24 19:27] (Version actuelle) |
||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
+ | {{howhard> | ||
+ | __**Wallpapers on desktop: | ||
+ | ====== The script: ====== | ||
+ | I have difficulties to find a solution to get a flexible diashow as wallpapers on the desktop. | ||
+ | Previously I used to let " | ||
+ | |||
+ | I found this script very close to what I want to have: the diashow runs in a random and recursively way through the sub-folders. | ||
+ | I only added the command for the Gnome3 desktop. | ||
+ | |||
+ | < | ||
+ | #!/bin/bash | ||
+ | |||
+ | function make_js { | ||
+ | | ||
+ | cat > $js << | ||
+ | var wallpaper = " | ||
+ | var activity = activities()[0]; | ||
+ | activity.currentConfigGroup = new Array(" | ||
+ | activity.writeConfig(" | ||
+ | activity.writeConfig(" | ||
+ | activity.reloadConfig(); | ||
+ | _EOF | ||
+ | } | ||
+ | |||
+ | | ||
+ | | ||
+ | qdbus org.kde.plasma-desktop / | ||
+ | # sleep 2 | ||
+ | | ||
+ | rm -f " | ||
+ | | ||
+ | | ||
+ | | ||
+ | # kbuildsycoca4 2>/ | ||
+ | } | ||
+ | |||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | echo ' | ||
+ | echo ' | ||
+ | echo 'group { name: " | ||
+ | echo 'data { item: " | ||
+ | echo ' | ||
+ | echo 'max: 990 742;' >> $edcFile | ||
+ | echo 'parts {' >> $edcFile | ||
+ | echo 'part { name: " | ||
+ | echo ' | ||
+ | echo ' | ||
+ | echo 'image { normal: "' | ||
+ | echo '} } } } }' >> $edcFile | ||
+ | | ||
+ | sleep 2 && rm -f ~/ | ||
+ | echo ' | ||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | function gnome3 { | ||
+ | # gsettings set org.gnome.desktop.background picture-filename " | ||
+ | gsettings set org.gnome.desktop.background picture-uri " | ||
+ | } | ||
+ | |||
+ | | ||
+ | | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | |||
+ | | ||
+ | " | ||
+ | | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | | ||
+ | } | ||
+ | |||
+ | DIR=$HOME/ | ||
+ | |||
+ | if [ " | ||
+ | usage | ||
+ | exit | ||
+ | fi | ||
+ | |||
+ | while true; do | ||
+ | X=`find $DIR -type f \( -name ' | ||
+ | |||
+ | # For Xfce | ||
+ | if [ " | ||
+ | | ||
+ | fi | ||
+ | # For LXDE | ||
+ | if [ " | ||
+ | | ||
+ | fi | ||
+ | # For Mate | ||
+ | if [ " | ||
+ | | ||
+ | fi | ||
+ | # For KDE4 | ||
+ | if [ " | ||
+ | | ||
+ | fi | ||
+ | # For e17 | ||
+ | if [ " | ||
+ | | ||
+ | fi | ||
+ | # For Gnome3 | ||
+ | if [ " | ||
+ | | ||
+ | fi | ||
+ | # | ||
+ | # If using Cairo-Dock add the following line | ||
+ | # | ||
+ | |||
+ | sleep 5m | ||
+ | |||
+ | done | ||
+ | exit 0 | ||
+ | |||
+ | </ | ||
+ | |||
+ | Notes: | ||
+ | *the script is done to work with a pictures folder " | ||
+ | *the change of the picture is set to 5 minutes. To modify it, adapt '' | ||
+ | *For Xfce, I had to modify the " | ||
+ | $ xfconf-query -c xfce4-desktop -l | grep " | ||
+ | *the script must be run in a terminal that must stay open until the end of the session. I don't have found a solution to make it to work as a daemon. < | ||
+ | |||
+ | ====== Use and integration with MATE: ====== | ||
+ | * create a link to the folder of the pictures < | ||
+ | ln -s / | ||
+ | * save this script under / | ||
+ | * create a script / | ||
+ | #!/bin/bash | ||
+ | |||
+ | / | ||
+ | killall mate-panel | ||
+ | exit 0; </ | ||
+ | * under " | ||
+ | |||
+ | ====== Use and integration with GNOME3: ====== | ||
+ | For Gnome3 the way is very simple: a [[Welcome: | ||
+ | [Desktop Entry] | ||
+ | Encoding=UTF-8 | ||
+ | Type=Application | ||
+ | Name=activation du diaporama de fonds d' | ||
+ | Comment=activation du diaporama de fonds d' | ||
+ | Comment[fr]=activation du diaporama de fonds d' | ||
+ | Exec=/ | ||
+ | Icon=/ | ||
+ | Categories=GTK; | ||
+ | Name[fr_FR]=activation du diaporama de fonds d' | ||
+ | ====== TO BE DONE: change the picture by every changing of virtual desktop: ====== | ||
+ | |||
+ | ===== For MATE ===== | ||
+ | |||
+ | This is only a draft in order to get another picture every time you go on another desktop (function present by " | ||
+ | |||
+ | Script to know the number of the active desktop: source: [[http:// | ||
+ | |||
+ | '' | ||
+ | |||
+ | #!/bin/bash | ||
+ | num=`wmctrl -d | grep ' | ||
+ | name=`wmctrl -lx | grep $1 | grep " $num " | tail -1` | ||
+ | host=`hostname` | ||
+ | out=`echo ${name## | ||
+ | |||
+ | if [[ -n " | ||
+ | then | ||
+ | `wmctrl -a " | ||
+ | else | ||
+ | $2 | ||
+ | fi </ | ||
+ | |||
+ | '' | ||
+ | gets the current desktop number | ||
+ | searches current desktop for the given name (parameter one) | ||
+ | |||
+ | then, depending on the result: | ||
+ | either switches to found app | ||
+ | or launches given app (parameter two)'' | ||
+ | |||
+ | |||