aboutsummaryrefslogtreecommitdiff
path: root/autoWall.sh
diff options
context:
space:
mode:
authorache <ache@ache.one>2019-03-15 06:41:21 +0100
committerache <ache@ache.one>2019-03-15 06:41:21 +0100
commiteca874ed3b9483ac5d5d04f9d6062330fb4e8478 (patch)
treed597389771eecbf91e620d1f26e8e069231c32d5 /autoWall.sh
parentVarious script (diff)
Wayland compatible
Diffstat (limited to 'autoWall.sh')
-rwxr-xr-xautoWall.sh15
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` ))