From 2e19701c7c03c1b75a243aa21727cb40e7149966 Mon Sep 17 00:00:00 2001 From: Joe Date: Mon, 24 Jun 2024 10:25:40 +0200 Subject: xinit --- .config/x11/xinitrc | 60 ++++++++++++++++++++++++++++++++++++++--------------- .local/bin/kb | 2 +- 2 files changed, 44 insertions(+), 18 deletions(-) diff --git a/.config/x11/xinitrc b/.config/x11/xinitrc index 400b41c..6c6f111 100644 --- a/.config/x11/xinitrc +++ b/.config/x11/xinitrc @@ -11,13 +11,17 @@ case $(hostname -s) in xscr="xscreensaver --no-splash" sleep="sleep 1" ping="ping -c1 -w1 9.9.9.9 >/dev/null 2>&1" + host="mother" + doas mkdir /var/run/jozan && doas chown -v jozan: /var/run/jozan ;; po-rbo) icon=" " mpd="mpd" xscr="xscreensaver" - sleep="sleep 1" + sleep="sleep 0.1" ping="ping -c1 -w1 9.9.9.9 >/dev/null 2>&1" + host="po-rbo" + doas mkdir /var/run/r_bousset && doas chown -v r_bousset: /var/run/r_bousset ;; mars) icon=" " @@ -25,10 +29,12 @@ case $(hostname -s) in xscr="xscreensaver --no-splash" sleep="gsleep 1" ping="ping -c1 -t1 9.9.9.9 >/dev/null 2>&1" + host="mars" + doas mkdir /var/run/jozan && doas chown -v jozan: /var/run/jozan ;; esac -doas mkdir /var/run/jozan && doas chown -v jozan: /var/run/jozan +[ $host = "po-rbo" ] && source "$HOME"/.config/env $ping && git --git-dir="$HOME"/docs/dotfiles-bsd --work-tree="$HOME" pull @@ -36,30 +42,47 @@ startif() { pgrep "$(basename "$1")" >/dev/null || "$@" >/dev/null 2>&1 & } +dunst_shit() { + sleep 1 + [ $host = "po-rbo" ] && startif /home/r_bousset/.nix-profile/bin/dunst || startif dunst + sleep 2 + startif mpd-notification + startif lowbat + for pid in $(ps aux | grep local/bin/kb | awk '{print $2}'); do + kill -9 $pid + done + "$HOME"/.local/bin/setwp "$HOME"/pics/wp.png + "$HOME"/.local/bin/kb & +} + +start_apps() { + startif copyq + startif nextcloud + [ $host = "po-rbo" ] && echo ads >/tmp/qwe || return + startif rclone-browser + startif teams + startif thunderbird + startif firefox +} + export LANG='en_US.UTF-8' -[ "$(hostname -s)" = "mother" ] && xrandr --output HDMI-0 --off \ +[ $host = "mother" ] && xrandr --output HDMI-0 --off \ --output DP-0 --mode 1440x900 --pos 0x0 --rotate normal \ --output DP-2 --mode 1440x900 --pos 3120x0 --rotate normal \ --output DP-4 --primary --mode 1680x1050 --pos 1440x0 --rotate normal \ --output DP-1 --off \ --output DP-3 --off \ --output DP-5 --off -[ "$(hostname -s)" = "po-rbo" ] && xrandr \ - --output eDP-1 --mode 1920x1200 --pos 5120x0 --rotate normal \ - --output DP-1 --mode 2560x1440 --pos 0x0 --rotate normal \ - --output HDMI-1 --primary --mode 2560x1440 --pos 2560x0 --rotate normal \ +[ $host = "po-rbo" ] && xrandr \ + --output eDP-1 --mode 1920x1200 --pos 0x0 --rotate normal \ + --output HDMI-1 --primary --mode 2560x1440 --pos 1920x0 --rotate normal \ + --output DP-1 --mode 2560x1440 --pos 4480x0 --rotate normal \ --output HDMI-2 --off \ --output VIRTUAL-1 --off -startif dunst +dunst_shit startif picom -startif mpd-notification pgrep $mpd >/dev/null || $mpd >/dev/null 2>&1 -"$HOME"/.local/bin/setwp "$HOME"/pics/the_wall.png -for pid in $(ps aux | grep local/bin/kb | awk '{print $2}'); do - kill -9 $pid -done -"$HOME"/.local/bin/kb & xset s off xset -dpms startif $xscr @@ -72,10 +95,13 @@ $sleep startif pipewire-pulse $sleep startif wireplumber -startif copyq -startif nextcloud +$sleep +startif nm-applet +$sleep +startif blueman-applet cd "$HOME" xrdb "$HOME"/.config/x11/xresources +start_apps & notify-send -u normal 'Welcome' "$icon Welcome back, partner!" -# exec dbus-launch dwm +[ $host = "po-rbo" ] && exec dwm diff --git a/.local/bin/kb b/.local/bin/kb index 871fe01..0d7c008 100755 --- a/.local/bin/kb +++ b/.local/bin/kb @@ -50,7 +50,7 @@ config_keyboard() { xset r rate 200 150 setxkbmap -option setxkbmap -layout us -variant intl - if [ "$(hostname -s)" = "motherqwe" ]; then + if [ "$(hostname -s)" = "po-rbo" ]; then setxkbmap -option ctrl:swapcaps setxkbmap -option caps:none xmodmap -e 'keycode 9 = Tab' -- cgit v1.2.3