aboutsummaryrefslogtreecommitdiff
path: root/install
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xinstall32
-rwxr-xr-xinstall.sh41
2 files changed, 32 insertions, 41 deletions
diff --git a/install b/install
new file mode 100755
index 0000000..3cb9223
--- /dev/null
+++ b/install
@@ -0,0 +1,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
diff --git a/install.sh b/install.sh
deleted file mode 100755
index 5b071b5..0000000
--- a/install.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/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