aboutsummaryrefslogtreecommitdiff
path: root/install.sh
blob: 5b071b5d1f1bc1016164ac866677dadacbcf4f5a (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
33
34
35
36
37
38
39
40
41
#!/bin/sh
programs="dwm dmenu slstatus st fetcha"

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

has_root_perms() {
  [ "$(id -u)" -eq 0 ] || [ -n "$SUDO_UID" ]
}

for program in $programs; do
  has_root_perms && (cd "$program" && echo "starting $program installation" && make clean install && echo "$program installation complete") || echo "Can't install $program: you must run the script as root or with sudo."
done

if command_exists picom; then
  if ! has_root_perms; then
    echo "Can't install picom configuration: you must run the script as root or with sudo."
    exit 1
  fi

  cp picom.conf /etc/xdg/picom.conf
  echo "picom &" >>~/.xinitrc
fi

if command_exists feh; then
  feh --bg-fill wallpaper.jpg
  echo "~/.fehbg &" >>~/.xinitrc
fi

command_exists flameshot && echo "flameshot &" >>~/.xinitrc

command_exists vis && cp vis -r ~/.config/

if command_exists tmux; then
  git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
  cp tmux -r ~/.config/
fi

echo "slstatus &" >>~/.xinitrc
echo "exec dwm" >>~/.xinitrc