aboutsummaryrefslogtreecommitdiff
path: root/install
blob: 3cb922370f22876c0c206e482bb53c84cfba240d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
programs="dwm dmenu slstatus st fetcha"

command_exists() {
  command -v "$1" >/dev/null 2>&1
}

if [ "$(id -u)" -eq 0 ] || [ -n "$SUDO_UID" ]; then
  read -p "Install laptop configuration instead of desktop? [y/N] " laptop
  if [ "$laptop" = "y" ] || [ "$laptop" = "Y" ]; then
    git apply laptop.diff
  fi

  for program in $programs; do
    (cd "$program" && echo "Starting $program installation" && make -s clean install && echo "$program installation complete" && make -s clean)
  done

  if command_exists picom; then
    echo "Copying picom configuration"
    cp picom.conf /etc/xdg/picom.conf
  fi
else
  echo "No root permissions, skipping installation of suckless programs and picom config"
fi


if command_exists feh; then
  echo "Creating ~/.fehbg"
  echo '#!/bin/sh' > ~/.fehbg
  echo "feh --no-fehbg --bg-fill $(pwd)/wallpaper.jpg" >> ~/.fehbg
  chmod 755 ~/.fehbg
fi