This commit is contained in:
stupidcomputer 2024-10-15 23:27:15 -05:00
commit 5ece5b7bc9
10 changed files with 215 additions and 19 deletions

18
.config/sxhkd/phone Normal file
View File

@ -0,0 +1,18 @@
# essentially the same thing as sxhkdrc, but super is replaced with ctrl + b and all shortcuts are chorded
ctrl + b; c
st
ctrl + b; q
bspc node -c
ctrl + b; {_,shift + } {1-9,0}
bspc {desktop -f,node -d} '{1-9,10}'
ctrl + b; {_,ctrl +,shift + }{h,j,k,l}
bspc node -{f,p,s} {west,south,north,east}
ctrl + b; d
tmenu_run
ctrl + b; m
mode phonemouse

43
.config/sxhkd/phonemouse Normal file
View File

@ -0,0 +1,43 @@
# exit mouse mode
w
mode phone
# move left
{ctrl +,shift +,_} h
xdotool mousemove_relative -- {-5,-50,-20} 0
# move down
{ctrl +,shift +,_} j
xdotool mousemove_relative -- 0 {5,50,20}
# move up
{ctrl +,shift +,_} k
xdotool mousemove_relative -- 0 {-5,-50,-20}
# move right
{ctrl +,shift +,_} l
xdotool mousemove_relative -- {5,50,20} 0
# left, middle, right click
{ctrl +,_} {a,s,d}
xdotool {mousedown,click} {1,2,3}
# let go of clicked button
q
xdotool mouseup 1; xdotool mouseup 2; xdotool mouseup 3
# move the mouse to the top of the window
g ; g
mousehelper top
# ditto for bottom
G
mousehelper bottom
# ditto for left
0
mousehelper left
# ditto for right
dollar
mousehelper right

View File

@ -35,6 +35,7 @@
libreoffice libreoffice
texliveMedium texliveMedium
ledger ledger
git-annex
]; ];
services.hardware.bolt.enable = true; # thunderbolt support services.hardware.bolt.enable = true; # thunderbolt support
@ -81,7 +82,7 @@
hostName = "mlg"; hostName = "mlg";
firewall = { firewall = {
enable = true; enable = true;
allowedTCPPorts = [ 6000 ]; allowedTCPPorts = [ 6000 8000 ];
allowedTCPPortRanges = [ allowedTCPPortRanges = [
{ from = 1714; to = 1764; } # KDE Connect { from = 1714; to = 1764; } # KDE Connect
]; ];

View File

@ -18,12 +18,17 @@
./franklincce.nix ./franklincce.nix
]; ];
# nix optimization nix = {
nix.optimise = { optimise = {
automatic = true; automatic = true;
dates = [ "03:45" ]; dates = [ "02:30" ];
};
gc = {
automatic = true;
dates = "03:15";
options = "-d";
};
}; };
time.timeZone = "America/Chicago"; time.timeZone = "America/Chicago";
@ -59,6 +64,7 @@
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKbhM3wj0oqjR3pUaZgpfX4Xo4dlzvBTbQ48zHyg7Pwx usr" # x230t "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKbhM3wj0oqjR3pUaZgpfX4Xo4dlzvBTbQ48zHyg7Pwx usr" # x230t
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILBGh1FHPneg7PCDkhMs2BCJPTIRVJkRTKpOj1w02ydD usr" # copernicus "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILBGh1FHPneg7PCDkhMs2BCJPTIRVJkRTKpOj1w02ydD usr" # copernicus
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGrpVDLQszFKoYbvYKRyVTTpehxR0BVU47SXkz39l2wK usr" # mainsail "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGrpVDLQszFKoYbvYKRyVTTpehxR0BVU47SXkz39l2wK usr" # mainsail
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB2xUbQw9+RCPVw7qCFm4NNCP/MpS2BIArcwMv0KdKOI usr" # mlg
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHZw5bg0TrvSkW/XQa4c+2iLbIKOxfMGbjy5Nb3HSfBv usr" # phone "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHZw5bg0TrvSkW/XQa4c+2iLbIKOxfMGbjy5Nb3HSfBv usr" # phone
]; ];
isNormalUser = true; isNormalUser = true;

View File

@ -1,14 +1,15 @@
termux: termux-pkgs termux-dots utils-sh st termux: termux-pkgs termux-dots utils-sh st
st: st:
cd builds/st/ && CC=clang make && cp st ~/.local/bin/st cd ../../../builds/st/ && CFLAGS="-DIS_PHONE" CC=clang make && cp st ~/.local/bin/st
utils-sh: utils-sh:
cp builds/utils/sh/* ~/.local/bin cp ../../../builds/utils/* ~/.local/bin
termux-pkgs: termux-pkgs:
pkg install \ pkg install \
neovim \ neovim \
xdotool \
git \ git \
tig \ tig \
tigervnc \ tigervnc \
@ -33,7 +34,7 @@ termux-pkgs:
x11-repo x11-repo
termux-dots: termux-dots:
ln -sf $(CURDIR)/.config ~/.config ln -sf $(CURDIR)/../../../.config ~/.config
ln -sf $(CURDIR)/home/ssh/config ~/.ssh/config ln -sf $(CURDIR)/../../../home/ssh/config ~/.ssh/config
ln -sf ~/.config/bash/bashrc ~/.bashrc ln -sf ~/.config/bash/bashrc ~/.bashrc
ln -sf ~/.config/bash/profile ~/.bash_profile ln -sf ~/.config/bash/profile ~/.bash_profile

View File

@ -3,7 +3,12 @@
/* /*
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
*/ */
#ifdef IS_PHONE
static char *font = "Monospace:pixelsize=34:antialias=true:autohint=true";
#else
static char *font = "Fantasque Sans Mono:pixelsize=14:antialias=true:autohint=true"; static char *font = "Fantasque Sans Mono:pixelsize=14:antialias=true:autohint=true";
#endif
static int borderpx = 2; static int borderpx = 2;
/* /*

View File

@ -186,6 +186,12 @@ case "$(hostname)" in
dunst & disown dunst & disown
phone pair & disown phone pair & disown
;; ;;
"localhost") # phone in termux
pkill sxhkd
sxhkd -c ~/.config/sxhkd/phone & disown
xrandr --output VNC-0 --mode 1920x1080
bspc monitor VNC-0 -d 1 2 3 4 5 6 7 8 9
esac esac
# initial post-wm setup # initial post-wm setup

116
builds/utils/establish-annex-link Executable file
View File

@ -0,0 +1,116 @@
#!/bin/bash
printf "This tool is for establishing sshfs links to transfer git-annex repo contents.\n"
printf "server or client?\n"
printf 'EITHER OF `s` or `c`\n'
read -p "?> "
case "$REPLY" in
s)
printf "[] ensure that port 22 is unfiltered\n"
sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT
printf "[] starting sshd\n"
sudo systemctl start sshd
WIRELESS_INTERFACE=$(
nmcli --get-values GENERAL.DEVICE,GENERAL.TYPE device show |
sed '/^wifi/!{h;d;};x' |
head -n1)
IP_OF_INTERFACE=$(
ip address show dev $WIRELESS_INTERFACE |
grep 'inet ' |
awk -F' ' '{print $2}' |
awk -F'/' '{print $1}')
printf "[] instruct client to connect to %s\n" "$IP_OF_INTERFACE"
printf "[] waiting to stop sshd\n"
read
sudo systemctl stop sshd
printf "[] sshd stopped, but port 22 still open\n"
;;
c)
printf "What IP to connect to?\n"
printf "ENSURE THAT the IP is accessable on the current VLAN\n"
printf 'ONE OF `ipv4 address`'
read -p "?> " ADDRESS
INFORMED_GUESS=$(ssh usr@$ADDRESS hostname)
if [ -z "$INFORMED_GUESS" ]; then
printf "What hostname?\n"
mkdir -p ~/annex-remotes
ls ~/annex-remotes
read -p "?> " REMOTE_HOST
else
REMOTE_HOST=$INFORMED_GUESS
printf "[] using hostname %s\n" "$INFORMED_GUESS"
fi
printf "[] mounting fs via sshfs\n"
mkdir -p ~/annex-remotes/$REMOTE_HOST
fusermount3 -qu ~/annex-remotes/$REMOTE_HOST
sshfs usr@$ADDRESS:/home/usr/annex ~/annex-remotes/$REMOTE_HOST
printf "[] mounted fs\n"
# check if the fuse mount worked
df_output=$(df -h | grep -c '/home/usr/annex')
if [ "$df_output" -eq 0 ]; then
printf "It seems the sshfs mount didn't work. Exiting.\n"
exit 1
fi
# check if we need to make a copy of the annex on the new device
if [ ! -d ~/annex-remotes/$REMOTE_HOST/.git ]; then
printf "Should I do that with the current computer's git-annex store?\n\n"
printf '`y`) initialize with the local store\n'
printf '`n`) no, just mount the sshfs\n'
read -p '?> '
case $REPLY in
y)
cd ~/annex-remotes/$REMOTE_HOST
printf "[] cloning the local git-annex store\n"
git clone -v ~/annex
shopt -s dotglob # include dotfiles and dotdirs in wildcard
mv ./annex/* . # move everything up a dir
if find "annex" -maxdepth 1 -type f -o -type d -empty; then # if annex is empty...
printf "[] removing spurious ./annex directory\n"
rm -r ./annex # ...remove it
fi
git annex init "$REMOTE_HOST"
cd ~/annex
git remote add $REMOTE_HOST ~/annex-remotes/$REMOTE_HOST
;;
esac # it's okay that the `n` and `*` cases fall-through
fi
printf "[] waiting to stop sshfs\n"
read
fusermount3 -u ~/annex-remotes/$REMOTE_HOST
printf "[] unmounted sshfs\n"
;;
*)
printf "unknown\n"
;;
esac

View File

@ -41,11 +41,11 @@
}, },
"locked": { "locked": {
"dir": "pkgs/firefox-addons", "dir": "pkgs/firefox-addons",
"lastModified": 1726632193, "lastModified": 1728307881,
"narHash": "sha256-oDT1HGKLn3HhzgmYwhSf31Rkpa7K2IBuhMsHGtLfAng=", "narHash": "sha256-stJXHgN3twyjLnQQQECa1LgdTyz6JuUHgEf8pjHz/rQ=",
"owner": "rycee", "owner": "rycee",
"repo": "nur-expressions", "repo": "nur-expressions",
"rev": "b487b142b50bb70d4d1a86625e9de4eff645b4d1", "rev": "60121cd3a79a4490206e172cbf00160dbc22f503",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
@ -93,11 +93,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1726592409, "lastModified": 1726989464,
"narHash": "sha256-2Y6CDvD/BD43WLS77PHu6dUHbdUfFhuzkY8oJAecD/U=", "narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "2ab00f89dd3ecf8012f5090e6d7ca1a7ea30f594", "rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -199,11 +199,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1726447378, "lastModified": 1728193676,
"narHash": "sha256-2yV8nmYE1p9lfmLHhOCbYwQC/W8WYfGQABoGzJOb1JQ=", "narHash": "sha256-PbDWAIjKJdlVg+qQRhzdSor04bAPApDqIv2DofTyynk=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "086b448a5d54fd117f4dc2dee55c9f0ff461bdc1", "rev": "ecbc1ca8ffd6aea8372ad16be9ebbb39889e55b6",
"type": "github" "type": "github"
}, },
"original": { "original": {