1 #!/bin/bash
   2 
   3 if [[ -f $1 ]]; then
   4     cp "$1" ~/.config/wallpaper.jpg
   5     hsetroot -fill $_
   6     gsettings set org.gnome.desktop.background picture-uri file://$_
   7 elif [[ $@ == *-i* ]]; then
   8     wal -o $0 --backend wal "$@" && read
   9     wal -o $0 --backend haishoku "$@" && read
  10     wal -o $0 --backend colorthief "$@" && read
  11     wal -o $0 --backend colorz "$@"
  12 elif [[ $@ ]]; then
  13     wal -o $0 "$@"
  14 fi
  15 
  16 [[ $@ ]] && exit
  17 source ~/.cache/wal/colors.sh
  18 
  19 # Pywal {{{
  20 
  21 sed -i 's/\\ec//' ~/.cache/wal/colors-tty.sh
  22 
  23 c=$(( $((16#$color7)) > $((16#$color15)) ? $color7 : $color15 ))
  24 sed -i "s/12;$cursor/12;$c/" ~/.cache/wal/sequences
  25 
  26 # }}}
  27 # Rofi {{{
  28 
  29 xrdb -merge <<X
  30 rofi.font: Ubuntu 11
  31 rofi.theme: ~/.cache/wal/colors-rofi-light.rasi
  32 rofi.cycle: false
  33 X
  34 
  35 echo '#element { padding: 5px 10px; }' \
  36 >> ~/.cache/wal/colors-rofi-light.rasi
  37 
  38 # }}}
  39 # i3/Polybar {{{
  40 
  41 xrdb -merge <<X
  42 fg: ${foreground}
  43 bg: ${background}
  44 bga: #cc${background:1}
  45 bgA: ${background}cc
  46 X
  47 
  48 i3-msg reload
  49 pkill -USR1 polybar
  50 
  51 # }}}
  52 # Notify {{{
  53 
  54 mkdir -p ~/.local/share/themes/wal/xfce-notify-4.0
  55 
  56 cat <<CSS > $_/gtk.css
  57 #XfceNotifyWindow {
  58     background: $background;
  59 }
  60 
  61 #XfceNotifyWindow * {
  62     border: none;
  63     border-radius: 1px;
  64 }
  65 
  66 #XfceNotifyWindow label {
  67     color: $foreground;
  68 }
  69 
  70 #XfceNotifyWindow label#summary {
  71     font-weight: bold;
  72     padding: 6px 0 10px 0;
  73 }
  74 
  75 #XfceNotifyWindow button {
  76     background: shade($background, 1.2);
  77 }
  78 
  79 #XfceNotifyWindow button:hover {
  80     background: shade($background, 1.6);
  81 }
  82 
  83 #XfceNotifyWindow progressbar * {
  84     min-height: 5px;
  85 }
  86 
  87 #XfceNotifyWindow progressbar progress {
  88     background: $foreground;
  89 }
  90 
  91 #XfceNotifyWindow progressbar trough {
  92     background: mix($background, $foreground, 0.2);
  93 }
  94 CSS
  95 
  96 pkill -USR1 xfce4-notifyd
  97 
  98 # }}}