From decee084aef991872c195ee9b73bf30fee2a9330 Mon Sep 17 00:00:00 2001 From: stupidcomputer Date: Mon, 30 Dec 2024 22:14:00 -0600 Subject: [PATCH] add some changes to copernicus graphical configuration --- builds/utils/bspwm-copernicus-welcome | 48 +++++++++ builds/utils/disp | 137 -------------------------- config/bspwm/bspwmrc | 64 ++++++++++-- config/sxhkd/sxhkdrc | 18 +++- 4 files changed, 119 insertions(+), 148 deletions(-) create mode 100755 builds/utils/bspwm-copernicus-welcome delete mode 100755 builds/utils/disp diff --git a/builds/utils/bspwm-copernicus-welcome b/builds/utils/bspwm-copernicus-welcome new file mode 100755 index 0000000..ec89996 --- /dev/null +++ b/builds/utils/bspwm-copernicus-welcome @@ -0,0 +1,48 @@ +# splash screen for bspwm on copernicus + +set -x + +if [ -z "$1" ]; then + st -g 78x11+0+0 -c st-gpg-menu -e bspwm-copernicus-welcome inner & disown + exit +fi + +case "$1" in + "helptext") + cat | less < /dev/null & + sleep 1 + num_jobs=$(jobs | wc -l) + if [ $num_jobs -gt 0 ]; then + # scrcpy started successfully + disown %- + break + fi + fi + done + exit + ;; + "inner") + tmux \ + new-session "bspwm-copernicus-welcome run-scrcpy" \; \ + split-window "bspwm-copernicus-welcome run-x11vnc" \; \ + new-window "bspwm-copernicus-welcome helptext" \; \ + set -g status off + ;; +esac diff --git a/builds/utils/disp b/builds/utils/disp deleted file mode 100755 index d64dd7b..0000000 --- a/builds/utils/disp +++ /dev/null @@ -1,137 +0,0 @@ -#!/bin/sh -# you can think of this more as post-wm setup - -set -x - -[ "$1" = "-h" ] && echo "use DISP_ACCESS_IP to control sshfs conn ip" && exit 0 - -set_walls() { - for i in $(xrandr | grep ' connected' | cut -d' ' -f1); do - xwallpaper --output $i --zoom ~/.local/share/pape.jpg - done -} - -screensaver () { - pkill xscreensaver - mkdir -p ~/.config/xscreensaver - HOME=".config/xscreensaver" xscreensaver --no-splash & 2>&1 > /dev/null -} - -keyboard () { - setxkbmap -option caps:super - pkill xcape - xcape -e 'Super_L=Escape' - xkbset bo 50 - xkbset exp =bo - xset -q | grep "Caps Lock:\s*on" && xdotool key Caps_Lock - xset -r 161 # tablet rotate key doesn't need repeat - xset r rate 200 80 -} - -find_card_pci() { - [ -z $pci_path ] && pci_path=$(find /sys/devices | \ - grep edid | \ - cut -d/ -f1-6 - ) -} - -assert_edid() { - find_card_pci - - out=$(sha256sum ${pci_path}/card0/card0-$1/edid | \ - cut -d' ' -f1) - - [ "$out" = "$2" ] && return 0 || return 1 -} - -exists() { - xrandr | grep ' connected' | grep -c "${1}" -} - -case "$(hostname)" in - "aristotle") - bspc monitor eDP-1 -d 01 02 03 04 05 06 07 08 09 - ;; - "mlg") - case "$1" in - "invert") - xrandr \ - --output DP-0 --off \ - --output DP-1-1 --primary --mode 1920x1080 --pos 0x352 --rotate normal --rate 180 \ - --output DP-1-2 --mode 1920x1080 --pos 1920x352 --rotate normal --rate 180 - bspc monitor DP-1-1 -d 01 03 05 07 - bspc monitor DP-1-2 -d 02 04 06 08 - ;; - "solo") - bspc monitor DP-0 -d 01 02 03 04 05 06 07 08 09 - ;; - *) - xrandr \ - --output DP-0 --off \ - --output DP-1-2 --primary --mode 1920x1080 --pos 0x352 --rotate normal --rate 180 \ - --output DP-1-1 --mode 1920x1080 --pos 1920x352 --rotate normal --rate 180 - bspc monitor DP-1-2 -d 01 03 05 07 - bspc monitor DP-1-1 -d 02 04 06 08 - ;; - esac - xinput set-prop 'INSTANT USB GAMING MOUSE ' 'libinput Accel Speed' -1 - - # setup synchronization - # check if we have another IP defined - if [ ! -z "$DISP_ACCESS_IP" ]; then - target="$DISP_ACCESS_IP" - else - target=x230t - fi - - pkill sshfs - rm $HOME/doc # this is safe, as doc is a dir if it mattered, - # but it's just a link, so it's a regular file. - # in conclusion, good either way - mkdir -p $HOME/.cache/mount_point - sshfs "usr@$target:/home/usr/doc" $HOME/.cache/mount_point -o ConnectTimeout=1 - ln -sf $HOME/.cache/mount_point $HOME/doc - - rm $HOME/.thunderbird # see previous comment - mkdir -p $HOME/.cache/mount_point3 - sshfs "usr@$target:/home/usr/.thunderbird" $HOME/.cache/mount_point3 -o ConnectTimeout=1 - ln -sf $HOME/.cache/mount_point3 $HOME/.thunderbird - - rm $HOME/Mail - mkdir -p $HOME/.cache/mount_point4 - sshfs "usr@$target:/home/usr/Mail" $HOME/.cache/mount_point4 -o ConnectTimeout=1 - ln -sf $HOME/.cache/mount_point4 $HOME/Mail - - rm $HOME/vdir - mkdir -p $HOME/.cache/mount_point5 - sshfs "usr@$target:/home/usr/vdir" $HOME/.cache/mount_point5 -o ConnectTimeout=1 - ln -sf $HOME/.cache/mount_point5 $HOME/vdir - - ;; - "copernicus") - case "$1" in - *) - bspc monitor HDMI-0 -d 01 02 03 04 05 06 07 08 09 - ;; - esac - ;; - "localhost") # phone in termux - xrandr --output VNC-0 --mode 1920x1080 - bspc monitor VNC-0 -d 01 02 03 04 05 06 07 08 09 - feh --bg-fill ~/.local/share/pape.jpg - bspc config top_padding 0 - bspc config bottom_padding 100 - mkdir -p ~/.cache/statusbar - pgrep -a st | \ - grep statusbar | \ - awk '{print $1}' | \ - xargs kill - termux-statusbar-polyfill start_statusbars - ;; -esac - -# initial post-wm setup -keyboard -statusbar start_statusbars -set_walls -screensaver diff --git a/config/bspwm/bspwmrc b/config/bspwm/bspwmrc index b5f7163..19d8825 100755 --- a/config/bspwm/bspwmrc +++ b/config/bspwm/bspwmrc @@ -1,5 +1,4 @@ #!/bin/sh -# rndusr's bspwmrc bspc rule -a st-gpg-menu state=floating bspc rule -a statusbar border=off sticky=on state=floating manage=off @@ -8,11 +7,9 @@ bspc rule -a Xmessage border=on state=floating bspc rule -a Zathura state=tiled bspc rule -a generic-st-window state=floating manage=on sticky=on border=on bspc rule -a floating-feh state=floating +bspc rule -a *:*:'phonercon' desktop=phonercon bspc rule -a send-to-9 desktop=09 -bspc rule -a steam desktop=1 -bspc rule -a discord desktop=2 - bspc config normal_border_color "#161510" bspc config active_border_color "#161510" bspc config focused_border_color "#727A18" @@ -24,7 +21,60 @@ bspc config focus_follows_pointer true bspc config window_gap 0 bspc config top_padding 20 -# post-wm configuration -disp - bspc desktop -f 01 + +set_walls() { + for i in $(xrandr | grep ' connected' | cut -d' ' -f1); do + xwallpaper --output $i --zoom ~/.local/share/pape.jpg + done +} +screensaver () { + pkill xscreensaver + mkdir -p ~/.config/xscreensaver + HOME=".config/xscreensaver" xscreensaver --no-splash & 2>&1 > /dev/null +} +start_statusbar () { + pkill statusbar + statusbar start_statusbars +} +keyboard () { + setxkbmap -option caps:super + pkill xcape + xcape -e 'Super_L=Escape' + xkbset bo 50 + xkbset exp =bo + xset -q | grep "Caps Lock:\s*on" && xdotool key Caps_Lock + xset -r 161 # tablet rotate key doesn't need repeat + xset r rate 200 80 +} + +desktops="01 02 03 04 05 06 07 08 09" +case "$(hostname)" in + "aristotle") + bspc monitor eDP-1 -d $desktops + ;; + "copernicus") + bspc monitor HDMI-0 -d $desktops phonercon aristrcon + if ! pkill -c scrcpy; then + bspwm-copernicus-welcome + fi + ;; + "localhost") # phone in termux + xrandr --output VNC-0 --mode 1920x1080 + bspc monitor VNC-0 -d $desktops + feh --bg-fill ~/.local/share/pape.jpg + bspc config top_padding 0 + bspc config bottom_padding 100 + mkdir -p ~/.cache/statusbar + pgrep -a st | \ + grep statusbar | \ + awk '{print $1}' | \ + xargs kill + termux-statusbar-polyfill start_statusbars + ;; +esac + +set_walls +screensaver +start_statusbar +keyboard diff --git a/config/sxhkd/sxhkdrc b/config/sxhkd/sxhkdrc index 47daeea..198f5e0 100644 --- a/config/sxhkd/sxhkdrc +++ b/config/sxhkd/sxhkdrc @@ -73,11 +73,21 @@ ctrl + b; {_,ctrl +,shift + }{h,j,k,l} bspc node -{f,p,s} {west,south,north,east} # change to or move a node to a desktop -super + {_,shift + } {1-9,0} - bspc {desktop -f,node -d} '0{1-9,0}' +super + {_,shift + } {1-9} + bspc {desktop -f,node -d} '0{1-9}' -ctrl + b; {_,shift + } {1-9,0} - bspc {desktop -f,node -d} '0{1-9,0}' +ctrl + b; {_,shift + } {1-9} + bspc {desktop -f,node -d} '0{1-9}' + +# on copernicus: phone and aristotle remote controls +super + 0 + bspc desktop -f phonercon +super + shift + 0 + bspc node -d phonercon +super + ctrl + 0 + bspc desktop -f aristrcon +super + ctrl + shift + 0 + bspc node -d aristrcon # change a node to tiling, floating, or fullscreen super + {t,f,s}