diff options
Diffstat (limited to 'autoWall.sh')
-rwxr-xr-x | autoWall.sh | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/autoWall.sh b/autoWall.sh index 8b709ed..b3df352 100755 --- a/autoWall.sh +++ b/autoWall.sh @@ -2,6 +2,12 @@ wallDir=/media/Wall +cmd='nitrogen --set-zoom-fill %s' + +if [ -n "$WAYLAND_DISPLAY" ] ; then + cmd='swaymsg output "*" background %s fill' +fi + for action in $@ do if [ ${action:0:1} = "+" ] @@ -52,9 +58,12 @@ for ligne in `cat ${wallDir}/listDirWall` do if [ `ls "${wallDir}/$ligne" | wc -l` -gt $randWall ] then - echo ${wallDir}/$ligne`ls ${wallDir}/$ligne | head -n $randWall | tail -n 1` > ~/.actWall - nitrogen --set-zoom-fill ${wallDir}/$ligne`ls ${wallDir}/$ligne | head -n $randWall | tail -n 1` - echo "Wall set " ${wallDir}/$ligne`ls ${wallDir}/$ligne | head -n $randWall | tail -n 1` + wall=${wallDir}/$ligne`ls ${wallDir}/$ligne | head -n $randWall | tail -n 1` + echo ${wall} > ~/.actWall + cmd=$(printf "${cmd}" ${wall}) + echo ${cmd} + eval ${cmd} + echo "Wall set $wall" break else randWall=$(( randWall - `ls "${wallDir}/$ligne" | wc -l` )) |