159 lines
4.5 KiB
Bash
Executable File
159 lines
4.5 KiB
Bash
Executable File
#!/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
|
|
*)
|
|
xinput set-prop 'INSTANT USB GAMING MOUSE ' 'libinput Accel Speed' -1
|
|
xrandr \
|
|
--output HDMI-0 --primary --mode 1920x1080 --pos 1920x1080 --rotate normal --rate 180 \
|
|
--output DP-0 --mode 1920x1080 --pos 0x1080 --rotate normal --rate 180 \
|
|
--output DP-1 --off \
|
|
--output DP-2 --mode 1920x1080 --pos 0x0 --rotate normal \
|
|
--output DP-3 --off \
|
|
--output DP-4 --off \
|
|
--output DP-5 --off \
|
|
--output DP-1-1 --off \
|
|
--output HDMI-1-1 --off \
|
|
--output HDMI-1-2 --mode 1920x1080 --pos 3840x485 --rotate normal \
|
|
--output DP-1-2 --mode 1920x1080 --pos 1920x0 --rotate normal
|
|
bspc monitor DP-0 -d 01 03 05 07 09
|
|
bspc monitor HDMI-0 -d 02 04 06 08 00
|
|
bspc monitor DP-2 -d 11 13 15 17 19
|
|
bspc monitor DP-1-2 -d 12 14 16 18
|
|
bspc monitor HDMI-1-2 -d 10
|
|
;;
|
|
esac
|
|
phone pair & disown
|
|
pkill jsfw
|
|
st -e sudo /run/current-system/sw/bin/jsfw client 192.168.1.211 24800 ~/dot_testing/boxes/copernicus/jsfw.json & disown
|
|
st -e sudo /run/current-system/sw/bin/jsfw client 192.168.1.211 24800 ~/dot_testing/boxes/copernicus/jsfw.json & disown
|
|
;;
|
|
"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
|