diff --git a/.config/khard/khard.conf b/.config/khard/khard.conf new file mode 100644 index 0000000..4e57eb3 --- /dev/null +++ b/.config/khard/khard.conf @@ -0,0 +1,19 @@ +[addressbooks] +[[main]] +path = ~/vdir/people/main/20cda0dd-5922-4905-8956-859c989a6519 +[general] +default_action = list +editor = nvim +merge_editor = nvim, -d + +[contact table] +display = first_name +group_by_addressbook = no +reverse = no +show_nicknames = no +show_uids = yes +show_kinds = no +sort = last_name +localize_dates = yes +preferred_phone_number_type = pref, cell, home +preferred_email_address_type = pref, work, home diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index feaa02d..25e4838 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -92,6 +92,7 @@ function setTabbing(lang, width) end setTabbing("python", 4) +setTabbing("htmldjango", 4) setTabbing("javascript", 4) setTabbing("css", 4) setTabbing("html", 4) diff --git a/.config/sx/sxrc b/.config/sx/sxrc index 03464ba..bec46c3 100755 --- a/.config/sx/sxrc +++ b/.config/sx/sxrc @@ -1,3 +1,3 @@ # start the wm -sxhkd & +mode sxhkdrc bspwm diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index e531a21..3c8bb65 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -50,5 +50,9 @@ super + {_,shift + } {1-9,0} super + {t,f,s} bspc node -t {tiled,floating,fullscreen} +# x230t specific -- activate the tablet menu XF86RotateWindows tabletmenu + +shift + Insert + special_ins diff --git a/README.md b/README.md index 088a689..f3a8393 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,9 @@ things to do license ------- -all materials, except for: - a) `./home/wallpapers/pape.jpg`, which is of unknown licenses, and - b) ./builds/st, which is licensed under MIT, persuant to ./builds/st/LICENSE, -is licensed under the GPLv3. +all materials in this repository, except for: + +* `./home/wallpapers/pape.jpg`, which is of unknown license, and +* `./builds/st`, which is licensed under MIT, persuant to `./builds/st/LICENSE`, + +is (c) rndusr, randomuser, stupidcomputer, etc 2024 and licensed under the GPLv3 (see `./LICENSE`) diff --git a/boxes/mlg/default.nix b/boxes/mlg/default.nix index e2de063..b05d4a0 100644 --- a/boxes/mlg/default.nix +++ b/boxes/mlg/default.nix @@ -10,7 +10,7 @@ ../../modules/common.nix ../../modules/x11.nix ../../modules/discord.nix - ../../modules/gaming.nix +# ../../modules/gaming.nix ../../modules/rbw.nix ]; diff --git a/boxes/netbox/default.nix b/boxes/netbox/default.nix index 9df004c..6592fe4 100644 --- a/boxes/netbox/default.nix +++ b/boxes/netbox/default.nix @@ -193,14 +193,6 @@ forceSSL = true; enableACME = true; root = "/var/www/beepboop.systems"; - locations."/" = { - extraConfig = '' - if ($request_uri ~ ^/(.*)\.html(\?|$)) { - return 302 /$1; - } - try_files $uri $uri.html $uri/ =404; - ''; - }; }; services.nginx.virtualHosts."git.beepboop.systems" = { diff --git a/builds/st.nix b/builds/st.nix index fa428cf..f6116a8 100644 --- a/builds/st.nix +++ b/builds/st.nix @@ -7,6 +7,7 @@ , fontconfig , freetype , ncurses +, lightMode ? false , extraLibs ? [ ] }: @@ -19,7 +20,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config fontconfig freetype ncurses ]; buildInputs = [ libX11 libXft ] ++ extraLibs; - buildPhase = '' + buildPhase = lib.optionalString (lightMode == true) "cp lightmode.h colors.h;" + + '' make ''; diff --git a/builds/st/lightmode.h b/builds/st/lightmode.h new file mode 100644 index 0000000..e70e37c --- /dev/null +++ b/builds/st/lightmode.h @@ -0,0 +1,20 @@ +/* Terminal colors (16 first used in escape sequence) */ +static const char *colorname[] = { + /* solarized light */ + "#eee8d5", /* 0: black */ + "#dc322f", /* 1: red */ + "#859900", /* 2: green */ + "#b58900", /* 3: yellow */ + "#268bd2", /* 4: blue */ + "#d33682", /* 5: magenta */ + "#2aa198", /* 6: cyan */ + "#073642", /* 7: white */ + "#fdf6e3", /* 8: brblack */ + "#cb4b16", /* 9: brred */ + "#93a1a1", /* 10: brgreen */ + "#839496", /* 11: bryellow */ + "#657b83", /* 12: brblue */ + "#6c71c4", /* 13: brmagenta*/ + "#586e75", /* 14: brcyan */ + "#002b36", /* 15: brwhite */ +}; diff --git a/builds/statusbar/setup.py b/builds/statusbar/setup.py index 493b970..5b3db72 100644 --- a/builds/statusbar/setup.py +++ b/builds/statusbar/setup.py @@ -7,7 +7,7 @@ setup( author_email = 'ryan@beepboop.systems', url = 'https://git.beepboop.systems/stupidcomputer/dot_testing', description = 'simple statusbar content program', - license = 'MIT', + license = 'GPLv3', entry_points = { 'console_scripts': [ 'statusbar = statusbar.statusbar:main' diff --git a/builds/statusbar/statusbar/statusbar.py b/builds/statusbar/statusbar/statusbar.py index 2fef7ed..bbb7c69 100644 --- a/builds/statusbar/statusbar/statusbar.py +++ b/builds/statusbar/statusbar/statusbar.py @@ -38,6 +38,32 @@ def generate_desktop_string(monitor_array): return ' '.join(output) +def filemodfactory(filename: str, modname: str): + def filemod(queue, _): + orig = 0 + while True: + new = os.path.getmtime(filename) + if(new > orig): + with open(filename, 'r') as f: + queue.put({ + "module": modname, + "data": f.read().rstrip() + }) + orig = new + time.sleep(0.1) + + return filemod + +def new_mail(queue, _): + while True: + dir_output = os.listdir("/home/usr/Mail/main/INBOX/new") + dir_output = len(dir_output) + queue.put({ + "module": "newmail", + "data": str(dir_output) + }) + time.sleep(20) + def bspwm(queue, monitor): client = socket.socket( socket.AF_UNIX, @@ -90,12 +116,13 @@ def filecheckerfactory(filename: str, modname: str, timeout=60): battery = filecheckerfactory("/sys/class/power_supply/BAT0/capacity", "bat") batterystatus = filecheckerfactory("/sys/class/power_supply/BAT0/status", "batstat") +sxhkdmode = filemodfactory("/home/usr/.cache/statusbar/sxhkd_mode", "sxhkdmode") def render(modules) -> str: columns, _ = os.get_terminal_size(0) - left = "{} | {}".format(modules["clock"], modules["bspwm"]) - right = "{}({})".format(modules["bat"], modules["batstat"]) + left = "{} | {}({})".format(modules["clock"], modules["bspwm"], modules["sxhkdmode"]) + right = "{} {}({})".format(modules["newmail"], modules["bat"], modules["batstat"]) padding = " " * (columns - len(left) - len(right) - 0) output = left + padding + right @@ -117,10 +144,12 @@ def render(modules) -> str: stdout.flush() def main(): + try: + os.mkdir("/home/usr/.cache/statusbar") + except FileExistsError: + pass + if argv[1] == "start_statusbars": -# signal.signal(signal.SIGINT, signal.SIG_IGN) -# os.system("pkill statusbar") -# signal.signal(signal.SIGINT, signal.SIG_DFL) # get the monitors xrandr = subprocess.Popen(['xrandr'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) output = list(xrandr.stdout) @@ -146,7 +175,7 @@ def main(): )) return queue = Queue() - modules = [bspwm, clock, battery, batterystatus] + modules = [bspwm, clock, battery, batterystatus, sxhkdmode, new_mail] [Process(target=module, args=(queue, argv[1])).start() for module in modules] module_outputs = defaultdict(lambda: "") diff --git a/builds/utils.nix b/builds/utils.nix index c84a2f2..da53dba 100644 --- a/builds/utils.nix +++ b/builds/utils.nix @@ -13,7 +13,6 @@ , figlet , curl , ytfzf -, herbe , xrandr , xrectsel , ffcast @@ -21,7 +20,6 @@ , xkbset , rbw , xclip -, libsForQt5 }: stdenv.mkDerivation rec { @@ -31,7 +29,7 @@ stdenv.mkDerivation rec { src = ./utils; nativeBuildInputs = [ makeWrapper ]; - buildInputs = [ bash feh xrandr jq curl fzy ytfzf sshuttle svkbd scrcpy xkbset rbw xclip ffcast libsForQt5.kolourpaint ]; + buildInputs = [ bash feh xrandr jq curl fzy ytfzf sshuttle svkbd scrcpy rbw xclip ffcast xkbset ]; installPhase = '' mkdir -p $out/bin @@ -39,7 +37,7 @@ stdenv.mkDerivation rec { for i in $(ls $src/sh); do cp $src/sh/$i $out/bin ln -sf $out/bin/tmenu_run $out/bin/regenerate - wrapProgram $out/bin/$i --prefix PATH : ${lib.makeBinPath [ sxhkd bash feh xrandr jq figlet curl fzy ytfzf herbe sshuttle svkbd scrcpy libsForQt5.kolourpaint xrectsel ffcast ]} + wrapProgram $out/bin/$i --prefix PATH : ${lib.makeBinPath [ sxhkd bash feh xrandr jq figlet curl fzy xkbset ytfzf sshuttle svkbd scrcpy xrectsel ffcast ]} done ''; } diff --git a/builds/utils/sh/disp b/builds/utils/sh/disp index 5d7f04b..62735f2 100755 --- a/builds/utils/sh/disp +++ b/builds/utils/sh/disp @@ -3,6 +3,8 @@ 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 @@ -56,49 +58,55 @@ case "$(hostname)" in case "$1" in "invert") xrandr \ - --output HDMI-0 --mode 1920x1080 --pos 3840x0 --rotate right --rate 60 \ - --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 1 3 5 7 - bspc monitor DP-1-1 -d 2 4 6 8 - bspc monitor HDMI-0 -d 9 - ;; - *) - xrandr \ - --output HDMI-0 --mode 1920x1080 --pos 3840x0 --rotate right --rate 60 \ --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 1 3 5 7 bspc monitor DP-1-2 -d 2 4 6 8 - bspc monitor HDMI-0 -d 9 + ;; + "solo") + bspc monitor DP-0 -d 1 2 3 4 5 6 7 8 9 + ;; + *) + 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 1 3 5 7 + bspc monitor DP-1-1 -d 2 4 6 8 ;; 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@x230t:/home/usr/doc $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@x230t:/home/usr/.thunderbird $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@x230t:/home/usr/Mail $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@x230t:/home/usr/vdir $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 ;; diff --git a/builds/utils/sh/mode b/builds/utils/sh/mode index 8aaf7e2..7ad2263 100755 --- a/builds/utils/sh/mode +++ b/builds/utils/sh/mode @@ -4,6 +4,7 @@ if [ -n "$1" ]; then pkill sxhkd sxhkd -c ~/.config/sxhkd/$1 & disown [ -f "~/.config/sxhkd/$1.sh" ] && ~/.config/sxhkd/$1.sh + echo "$1" > ~/.cache/statusbar/sxhkd_mode exit fi diff --git a/builds/utils/sh/special_ins b/builds/utils/sh/special_ins new file mode 100755 index 0000000..6cc23c9 --- /dev/null +++ b/builds/utils/sh/special_ins @@ -0,0 +1,14 @@ +# insert special characters universally in xorg + +( +tmenu <