local/bin/wall

   1 #!/bin/bash
   2 
   3 wal=~/.cache/wal
   4 source $wal/colors.sh
   5 
   6 if [[ $@ == -* ]]; then
   7     [[ $1 == -i && -f $2 ]] && $0 "$2"
   8     [[ $1 == -R ]] && $0 ~/.config/wallpaper.jpg
   9 
  10     wal -o $0 --vte "$@"
  11 elif [[ -f $1 ]]; then
  12     cp "$1" ~/.config/wallpaper.jpg
  13     hsetroot -solid "${background:-#000000}" -fill $_
  14 
  15     gsettings set org.cinnamon.desktop.background picture-uri "file://$_"
  16     gsettings set org.cinnamon.desktop.background primary-color "$background"
  17 fi
  18 
  19 [[ $@ ]] && exit
  20 
  21 $0 ~/.config/wallpaper.jpg &
  22 cat $wal/*.xres | xrdb -merge
  23 
  24 sed -i 's/\\ec//' $wal/colors-tty.sh
  25 sed -i "s/12;$cursor/12;$foreground/" $wal/sequences
  26 
  27 mkdir -p ~/.local/share/themes/wal/xfce-notify-4.0
  28 ln -s $wal/notifyd.gtkrc $_/gtkrc
  29 ln -s $wal/notifyd.css   ${_:0:-2}.css
  30 
  31 i3-msg restart
  32 pkill -HUP dwm
  33 pkill -HUP awesome
  34 echo restart | qshell
  35 
  36 pkill dunst
  37 pkill xfce4-notifyd
  38 
  39 sleep 0.2
  40 pkill -USR1 sxhkd
  41 pkill -USR1 polybar