~noasakurajin/xapp/master

« back to all changes in this revision

Viewing changes to scripts/xfce4-set-wallpaper

  • Committer: Michael Webster
  • Author(s): worldofpeace
  • Date: 2020-01-08 03:33:00 UTC
  • Revision ID: git-v1:89ad087f22d9c5f3694585e6b5be5aa364de0e76
Install icons and scripts using meson options

With meson there's no point for a package to try to write to
'/' when there's built in options like 'bindir' and 'datadir' which
are the actual directories we want these files installed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
# Author: Weitian Leung <weitianleung@gmail.com>
 
4
# Version: 2.0
 
5
# License: GPL-3.0
 
6
# Description: set a picture as xfce4 wallpaper
 
7
 
 
8
wallpaper=$1
 
9
 
 
10
# check image
 
11
mime_type=`file --mime-type -b "$wallpaper"`
 
12
if [[ ! "$mime_type" == image/* ]]; then
 
13
        echo "Invalid image"
 
14
        exit 1
 
15
fi
 
16
 
 
17
# set to every monitor that contains image-path/last-image
 
18
properties=$(xfconf-query -c xfce4-desktop -p /backdrop -l | grep -e "screen.*/monitor.*image-path$" -e "screen.*/monitor.*/last-image$")
 
19
 
 
20
for property in $properties; do
 
21
        xfconf-query -c xfce4-desktop -p $property -s "$wallpaper"
 
22
done