Guest User

Setup script for Plank-themer

a guest
Jun 10th, 2014
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.87 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Variables
  4. _install="/usr/share/plank-themer"
  5. _plank1="$HOME/.config/plank/dock1"
  6.  
  7. # Install the dockitem to userspace
  8. cp "$_install/theme_index/plank-themer-ondock.dockitem" "$_plank1/launchers/"
  9.  
  10. # Place dockitem in Plank (at start?)
  11. const='plank-themer-ondock.dockitem'
  12. if [ -e "$_plank1/settings" ]; then
  13.     grep -q -e "$const" "$_plank1/settings"
  14.     echo "dockitem already there, nothing to do"
  15.     if [ $? = 1 ]; then
  16.         echo "$const; not found but will be inserted as first item!"
  17.         # This could probably be simplified; what's going on here?
  18.         sed -i 's@DockItems=plank.dockitem;;@DockItems=plank.dockitem;;plank-themer-ondock.dockitem;;@' "$_plank1/settings"
  19.         sed -i 's@DockItems=plank.dockitem;;@DockItems=plank.dockitem;;plank-themer-ondock.dockitem;;@' "$_plank1/settings"
  20.         sed -i '[email protected]\n@\n@g' "$_plank1/settings"
  21.     fi
  22. fi
Advertisement
Add Comment
Please, Sign In to add comment