2020-11-02 04:08:18 +00:00
|
|
|
#!/bin/sh
|
2020-11-08 16:26:14 +00:00
|
|
|
DIR=$(dirname "$(readlink -f "$0")")
|
2020-11-02 04:08:18 +00:00
|
|
|
. "$DIR/../env.sh"
|
2020-09-17 10:24:35 +00:00
|
|
|
|
2020-11-21 18:07:26 +00:00
|
|
|
log 'Setting up suckless'
|
2020-09-17 02:47:33 +00:00
|
|
|
# install dependencies
|
2020-09-17 10:24:35 +00:00
|
|
|
case "$PM" in
|
|
|
|
apt)
|
|
|
|
sudo apt install \
|
2022-05-15 03:34:22 +00:00
|
|
|
dunst \
|
2020-09-17 10:24:35 +00:00
|
|
|
trayer
|
|
|
|
sudo apt remove gdm3
|
|
|
|
;;
|
|
|
|
pacman)
|
2020-11-21 18:07:26 +00:00
|
|
|
sudo pacman -S --noconfirm --needed \
|
2021-08-26 13:13:36 +00:00
|
|
|
trayer \
|
2022-05-15 03:34:22 +00:00
|
|
|
dunst \
|
2021-08-26 13:13:36 +00:00
|
|
|
xorg-xsetroot
|
2020-09-17 10:24:35 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2020-09-17 03:07:58 +00:00
|
|
|
# clone / compile utilities and dwm itself
|
2020-11-08 16:26:14 +00:00
|
|
|
|
|
|
|
|
2022-05-03 15:20:26 +00:00
|
|
|
$DIR/dmenu.sh
|
|
|
|
$DIR/slock.sh
|
|
|
|
$DRI/dict.sh
|
|
|
|
makeinstallrepo https://gitee.com/klesh/dwm.git dwm
|
2020-09-17 03:07:58 +00:00
|
|
|
|
|
|
|
# config xinit to start for dwm
|
|
|
|
cat <<EOT > ~/.xinitrc
|
2020-09-30 15:04:51 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-09-17 03:07:58 +00:00
|
|
|
export QT_QPA_PLATFORMTHEME="qt5ct"
|
|
|
|
export GTK2_RC_FILES="$HOME/.gtkrc-2.0"
|
|
|
|
|
|
|
|
export XMODIFIERS="@im=ibus"
|
2020-09-25 07:48:37 +00:00
|
|
|
export QT_IM_MODULE=ibus
|
2020-09-22 04:26:27 +00:00
|
|
|
export GTK_IM_MODULE=xim
|
2020-09-17 03:07:58 +00:00
|
|
|
|
2020-09-30 15:04:51 +00:00
|
|
|
# setup gnome keyring
|
2020-09-17 03:07:58 +00:00
|
|
|
dbus-update-activation-environment --systemd DISPLAY
|
2020-10-08 15:37:05 +00:00
|
|
|
export SSH_AUTH_SOCK=$(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh)
|
2020-09-17 03:07:58 +00:00
|
|
|
|
2020-09-30 15:04:51 +00:00
|
|
|
# load monitors profile
|
2020-09-17 03:07:58 +00:00
|
|
|
autorandr --change --force
|
2020-09-30 15:04:51 +00:00
|
|
|
|
|
|
|
# restart dwm if it existed without error
|
2020-11-08 16:26:14 +00:00
|
|
|
xrdb -query > /tmp/dwm.log
|
2020-09-17 03:07:58 +00:00
|
|
|
while :; do
|
2020-11-05 04:30:12 +00:00
|
|
|
ssh-agent dwm 2>>/tmp/dwm.log || break
|
2020-09-17 03:07:58 +00:00
|
|
|
done
|
|
|
|
EOT
|
2020-09-17 16:02:24 +00:00
|
|
|
|
2020-11-24 18:18:57 +00:00
|
|
|
cat <<'EOT' | sed "s|__PDIR__|$PDIR|g" > ~/.profile
|
2020-10-31 17:36:55 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-11-24 18:18:57 +00:00
|
|
|
export PATH=__PDIR__/bin:$HOME/.local/bin:$PATH
|
2020-11-04 03:58:06 +00:00
|
|
|
export VIM_MODE=enhanced
|
2020-11-08 16:26:14 +00:00
|
|
|
export DMENU_DEFAULT_OPTS='-i -c -fn monospace:13 -nb #222222 -nf #bbbbbb -sb #5b97f7 -sf #eeeeee -l 20'
|
2021-09-26 16:05:34 +00:00
|
|
|
export TMUX_SHELL=$(command -v fish)
|
2020-11-01 17:50:32 +00:00
|
|
|
|
2020-10-31 17:36:55 +00:00
|
|
|
# auto startx
|
2020-11-05 04:30:12 +00:00
|
|
|
[ -z "$DISPLAY" ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq "1" ] \
|
2021-09-15 15:08:44 +00:00
|
|
|
&& startx -- -keeptty >~/.xorg.log 2>&1
|
2020-10-31 17:36:55 +00:00
|
|
|
EOT
|
|
|
|
|
2020-09-17 16:02:24 +00:00
|
|
|
|
|
|
|
# config dwm
|
2020-11-02 04:08:18 +00:00
|
|
|
mkdir -p "$XDG_CONFIG_HOME/dwm"
|
2020-11-21 18:07:26 +00:00
|
|
|
lnsf "$DIR/dwm/autostart" "$XDG_CONFIG_HOME/dwm/autostart"
|