From d3db1dd52ab8167d5c568fd6eecc4c5c9bc7d50c Mon Sep 17 00:00:00 2001 From: dheera Date: Sat, 12 Jul 2025 12:59:06 -0700 Subject: [PATCH 01/15] dconf --- install/vars/common.dconf | 4 ++++ install/vars/laptop.dconf | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/install/vars/common.dconf b/install/vars/common.dconf index c56f9e0..ce7a188 100644 --- a/install/vars/common.dconf +++ b/install/vars/common.dconf @@ -15,3 +15,7 @@ show-battery-percentage=false [com/github/libpinyin/ibus-libpinyin/libpinyin] opencc-config='s2tw.json' + +[org/gnome/nautilus/preferences] +default-folder-viewer='list-view' + diff --git a/install/vars/laptop.dconf b/install/vars/laptop.dconf index f621b73..fa2d4c5 100644 --- a/install/vars/laptop.dconf +++ b/install/vars/laptop.dconf @@ -17,6 +17,8 @@ focus-highlight-opacity=20 hot-keys=false hotkeys-overlay-combo='TEMPORARILY' leftbox-padding=-1 +leftbox-size=18 +multi-monitors=false panel-anchors='{"0":"MIDDLE"}' panel-element-positions='{"0":[{"element":"activitiesButton","visible":false,"position":"stackedTL"},{"element":"showAppsButton","visible":true,"position":"stackedTL"},{"element":"leftBox","visible":true,"position":"stackedTL"},{"element":"taskbar","visible":true,"position":"stackedTL"},{"element":"centerBox","visible":true,"position":"stackedBR"},{"element":"rightBox","visible":true,"position":"stackedBR"},{"element":"systemMenu","visible":true,"position":"stackedBR"},{"element":"dateMenu","visible":true,"position":"stackedTL"},{"element":"desktopButton","visible":false,"position":"stackedBR"}]}' panel-lengths='{"0":100}' @@ -33,4 +35,19 @@ trans-use-custom-gradient=false trans-use-custom-opacity=true tray-padding=-1 tray-size=16 +tray-size=18 window-preview-title-position='TOP' + +[org/gnome/shell/extensions/panel-date-format] +format='%H\n%M' + +[org/gnome/desktop/interface] +text-scaling-factor=1.25 + +[org/gnome/nautilus/list-view] +default-zoom-level='medium' + +[org/gtk/settings/color-chooser] +custom-colors=[(0.16470588235294117, 0.4823529411764706, 0.87058823529411766, 1.0), (0.0, 0.16862745098039217, 0.21176470588235294, 1.0)] +selected-color=(true, 0.16470588235294117, 0.4823529411764706, 0.87058823529411766, 1.0) + From 259bb7b4056e388f0d2eb2c6c9ca8065d71f5142 Mon Sep 17 00:00:00 2001 From: dheera Date: Sat, 12 Jul 2025 12:59:40 -0700 Subject: [PATCH 02/15] edit-google-chrome-set-default-scale-factor-1.25 --- install/edit/edit-google-chrome-set-default-scale-factor-1.25 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/edit/edit-google-chrome-set-default-scale-factor-1.25 b/install/edit/edit-google-chrome-set-default-scale-factor-1.25 index 88d642e..f35a197 100755 --- a/install/edit/edit-google-chrome-set-default-scale-factor-1.25 +++ b/install/edit/edit-google-chrome-set-default-scale-factor-1.25 @@ -16,7 +16,7 @@ sudo cp "$FILE" "$BACKUP_FILE" echo "Backup created at $BACKUP_FILE" # Perform the replacement using sed -sudo sed -i 's|Exec=/usr/bin/google-chrome-stable|Exec=/usr/bin/google-chrome-stable --force-device-scale-factor=1.25|g' "$FILE" +sudo sed -i 's|Exec=/usr/bin/google-chrome-stable|Exec=/usr/bin/google-chrome-stable --force-device-scale-factor=1.5 --disable-session-crashed-bubble --disable-infobars|g' "$FILE" echo "Replacement completed successfully." From 69a2175903f8047f84b77581b7c808e84cd23bd1 Mon Sep 17 00:00:00 2001 From: dheera Date: Sat, 12 Jul 2025 12:59:58 -0700 Subject: [PATCH 03/15] edit-google-chrome- --- ...-set-default-scale-factor-1.25 => edit-google-chrome-defaults} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename install/edit/{edit-google-chrome-set-default-scale-factor-1.25 => edit-google-chrome-defaults} (100%) diff --git a/install/edit/edit-google-chrome-set-default-scale-factor-1.25 b/install/edit/edit-google-chrome-defaults similarity index 100% rename from install/edit/edit-google-chrome-set-default-scale-factor-1.25 rename to install/edit/edit-google-chrome-defaults From 3b982a5d9e0dd28a07798474b096cff583dfeff9 Mon Sep 17 00:00:00 2001 From: dheera Date: Sat, 12 Jul 2025 21:07:33 -0700 Subject: [PATCH 04/15] add 1password isntall --- install/1password.install | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 install/1password.install diff --git a/install/1password.install b/install/1password.install new file mode 100755 index 0000000..39e7be5 --- /dev/null +++ b/install/1password.install @@ -0,0 +1,9 @@ +#!/usr/bin/env python3 + +curl -sS https://downloads.1password.com/linux/keys/1password.asc | sudo gpg --dearmor --output /usr/share/keyrings/1password-archive-keyring.gpg +echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/1password-archive-keyring.gpg] https://downloads.1password.com/linux/debian/amd64 stable main' | sudo tee /etc/apt/sources.list.d/1password.list +sudo mkdir -p /etc/debsig/policies/AC2D62742012EA22/ +curl -sS https://downloads.1password.com/linux/debian/debsig/1password.pol | sudo tee /etc/debsig/policies/AC2D62742012EA22/1password.pol +sudo mkdir -p /usr/share/debsig/keyrings/AC2D62742012EA22 +curl -sS https://downloads.1password.com/linux/keys/1password.asc | sudo gpg --dearmor --output /usr/share/debsig/keyrings/AC2D62742012EA22/debsig.gpg +sudo apt update && sudo apt install 1password From f7ed2935fcbea71a9c5712166db54e06db9a9af0 Mon Sep 17 00:00:00 2001 From: dheera Date: Sat, 12 Jul 2025 21:08:29 -0700 Subject: [PATCH 05/15] nodejs.install --- install/nodejs.install | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/install/nodejs.install b/install/nodejs.install index a7a567e..cb2b7bd 100755 --- a/install/nodejs.install +++ b/install/nodejs.install @@ -1,10 +1,13 @@ #!/bin/bash - -curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash -export NVM_DIR="$HOME/.nvm" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm -[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" -nvm install 20 -node -v # should print `v20.14.0` -npm -v - +# +# Download and install nvm: +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash +# in lieu of restarting the shell +\. "$HOME/.nvm/nvm.sh" +# Download and install Node.js: +nvm install 24 +# Verify the Node.js version: +node -v # Should print "v24.4.0". +nvm current # Should print "v24.4.0". +# Verify npm version: +npm -v # Should print "11.4.2". From b7449401bea4016ba9d774bdc94acf7f18ac1694 Mon Sep 17 00:00:00 2001 From: dheera Date: Tue, 15 Jul 2025 22:37:48 +0000 Subject: [PATCH 06/15] laptop.dconf --- install/vars/laptop.dconf | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/install/vars/laptop.dconf b/install/vars/laptop.dconf index f621b73..f75cf85 100644 --- a/install/vars/laptop.dconf +++ b/install/vars/laptop.dconf @@ -5,8 +5,8 @@ animate-appicon-hover-animation-extent={'RIPPLE': 4, 'PLANK': 4, 'SIMPLE': 1} animate-appicon-hover-animation-travel={'SIMPLE': 0.10000000000000001, 'RIPPLE': 0.40000000000000002, 'PLANK': 0.0} animate-appicon-hover-animation-type='SIMPLE' animate-appicon-hover-animation-zoom={'SIMPLE': 1.2, 'RIPPLE': 1.25, 'PLANK': 2.0} -appicon-margin=2 -appicon-padding=10 +appicon-margin=0 +appicon-padding=8 available-monitors=[0] dot-position='LEFT' dot-style-focused='SQUARES' @@ -14,9 +14,11 @@ dot-style-unfocused='SQUARES' focus-highlight=true focus-highlight-dominant=true focus-highlight-opacity=20 +global-border-radius=2 hot-keys=false hotkeys-overlay-combo='TEMPORARILY' leftbox-padding=-1 +leftbox-size=18 panel-anchors='{"0":"MIDDLE"}' panel-element-positions='{"0":[{"element":"activitiesButton","visible":false,"position":"stackedTL"},{"element":"showAppsButton","visible":true,"position":"stackedTL"},{"element":"leftBox","visible":true,"position":"stackedTL"},{"element":"taskbar","visible":true,"position":"stackedTL"},{"element":"centerBox","visible":true,"position":"stackedBR"},{"element":"rightBox","visible":true,"position":"stackedBR"},{"element":"systemMenu","visible":true,"position":"stackedBR"},{"element":"dateMenu","visible":true,"position":"stackedTL"},{"element":"desktopButton","visible":false,"position":"stackedBR"}]}' panel-lengths='{"0":100}' @@ -25,12 +27,12 @@ panel-sizes='{"0":64}' primary-monitor=0 show-apps-icon-file='' show-apps-icon-side-padding=4 -status-icon-padding=8 +status-icon-padding=5 stockgs-keep-dash=false stockgs-keep-top-panel=false trans-panel-opacity=0.40000000000000002 trans-use-custom-gradient=false trans-use-custom-opacity=true tray-padding=-1 -tray-size=16 +tray-size=14 window-preview-title-position='TOP' From ad8f3c0b4d6ea9694fee957b57bec49a59e726bb Mon Sep 17 00:00:00 2001 From: dheera Date: Thu, 25 Dec 2025 22:24:08 +0000 Subject: [PATCH 07/15] upsmon.conf --- install/files/etc/nut/upsmon.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/files/etc/nut/upsmon.conf b/install/files/etc/nut/upsmon.conf index ffa2835..c8ee881 100644 --- a/install/files/etc/nut/upsmon.conf +++ b/install/files/etc/nut/upsmon.conf @@ -30,7 +30,7 @@ # (Unprivileged) OS account to run as: # RUN_AS_USER nut -MONITOR ups@10.10.10.2 1 monuser secret slave +MONITOR ups@10.10.11.2 1 monuser secret slave # -------------------------------------------------------------------------- # MONITOR ("primary"|"secondary") @@ -217,7 +217,7 @@ SHUTDOWNCMD "/sbin/shutdown -h +0" # For more information and ideas, see docs/scheduling.txt # # Example: -# NOTIFYCMD /bin/notifyme +NOTIFYCMD /home/dheera/bin/scripts/notifyme # -------------------------------------------------------------------------- # POLLFREQ From 24e24b5800e70378cb539899c950bc0e3a4c71a8 Mon Sep 17 00:00:00 2001 From: dheera Date: Thu, 25 Dec 2025 22:24:15 +0000 Subject: [PATCH 08/15] blacklist-kvm.conf --- install/files/etc/modprobe.d/blacklist-kvm.conf | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 install/files/etc/modprobe.d/blacklist-kvm.conf diff --git a/install/files/etc/modprobe.d/blacklist-kvm.conf b/install/files/etc/modprobe.d/blacklist-kvm.conf new file mode 100644 index 0000000..373c745 --- /dev/null +++ b/install/files/etc/modprobe.d/blacklist-kvm.conf @@ -0,0 +1,2 @@ +blacklist kvm-amd +blacklist kvm From 9a13136b7748399d7899acba3f934698f63ad981 Mon Sep 17 00:00:00 2001 From: dheera Date: Fri, 26 Dec 2025 17:30:19 +0000 Subject: [PATCH 09/15] fix unicode filename 404; fix even number of monitors QR appearing in middle split across 2 monitors --- util/clip2qr | 51 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 4 deletions(-) diff --git a/util/clip2qr b/util/clip2qr index d178b99..087ae8c 100755 --- a/util/clip2qr +++ b/util/clip2qr @@ -23,12 +23,54 @@ import threading import os import random import string -from urllib.parse import urlparse, parse_qs +import subprocess +import re +from urllib.parse import urlparse, parse_qs, unquote import PIL.Image if os.environ['XDG_SESSION_TYPE'] == 'wayland': pyperclip.set_clipboard('wl-clipboard') +def get_monitors(): + """ + Get list of monitor geometries using xrandr. + Returns list of (x, y, width, height) tuples for each connected monitor. + """ + try: + output = subprocess.check_output(['xrandr', '--query'], stderr=subprocess.DEVNULL, text=True) + monitors = [] + # Match lines like: "DP-1 connected primary 2560x1440+0+0" or "HDMI-1 connected 1920x1080+2560+0" + pattern = r'\bconnected\b.*?(\d+)x(\d+)\+(\d+)\+(\d+)' + for line in output.splitlines(): + if ' connected' in line: + match = re.search(pattern, line) + if match: + w, h, x, y = map(int, match.groups()) + monitors.append((x, y, w, h)) + return monitors + except (subprocess.CalledProcessError, FileNotFoundError): + return [] + +def get_display_position(img_width, img_height, screen_width, screen_height): + """ + Determine the best position to display the QR code. + For even number of monitors, center on the first monitor. + For odd number (or if detection fails), center on the combined screen. + """ + monitors = get_monitors() + + if len(monitors) > 0 and len(monitors) % 2 == 0: + # Even number of monitors - use the first one to avoid splitting + x, y, w, h = monitors[0] + pos_x = x + w // 2 - img_width // 2 + pos_y = y + h // 2 - img_height // 2 + else: + # Odd number of monitors or detection failed - center on combined screen + pos_x = screen_width // 2 - img_width // 2 + pos_y = screen_height // 2 - img_height // 2 + + return pos_x, pos_y + def get_qr(url:str, size:int = 960): """ input: url as str @@ -55,8 +97,7 @@ def show_image(img: PIL.Image): screen_height = win.winfo_screenheight() window = Toplevel(win) - x = screen_width // 2 - img.size[0]// 2 + 1000 - y = screen_height // 2 - img.size[1] // 2 + x, y = get_display_position(img.size[0], img.size[1], screen_width, screen_height) window.geometry(f"{img.size[0]}x{img.size[1]}+{x}+{y}") window.overrideredirect(1) @@ -89,7 +130,9 @@ class FileServer(object): def do_GET(self): parsed_path = urlparse(self.path) query_params = parse_qs(parsed_path.query) - if parsed_path.path == f'/{filename}' and query_params.get('password', [None])[0] == password: + # URL-decode the path to handle non-ASCII characters (e.g., Chinese filenames) + decoded_path = unquote(parsed_path.path) + if decoded_path == f'/{filename}' and query_params.get('password', [None])[0] == password: super().do_GET() else: self.send_error(404, "File Not Found") From bbf674cc83cd3365e6b2bba62bd404f5e970233a Mon Sep 17 00:00:00 2001 From: dheera Date: Fri, 26 Dec 2025 17:36:00 +0000 Subject: [PATCH 10/15] fix stop_server bug --- util/clip2qr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/clip2qr b/util/clip2qr index 087ae8c..c46e383 100755 --- a/util/clip2qr +++ b/util/clip2qr @@ -108,7 +108,7 @@ def show_image(img: PIL.Image): label.bind("", lambda event: (win.destroy(), server.stop() if server is not None else None)) label.pack() - win.after(30000, lambda: (win.destroy(), stop_server())) + win.after(30000, lambda: (win.destroy(), server.stop() if server is not None else None)) win.mainloop() server = None From a2915a57cd2646f5be3a3b25220184ecf2398b57 Mon Sep 17 00:00:00 2001 From: dheera Date: Sat, 27 Dec 2025 18:31:01 +0000 Subject: [PATCH 11/15] geolocate-wifi --- util/geolocate-wifi | 78 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100755 util/geolocate-wifi diff --git a/util/geolocate-wifi b/util/geolocate-wifi new file mode 100755 index 0000000..6632448 --- /dev/null +++ b/util/geolocate-wifi @@ -0,0 +1,78 @@ +#!/usr/bin/env python3 + +import argparse +import os +import sys +from subprocess import Popen, PIPE +import requests + +def call(cmd): + p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE) + output, err = p.communicate() + return output.decode('utf-8') + +def scan(rescan=True): + accesspoints = [] + if rescan: + call(['nmcli', 'dev', 'wifi', 'rescan']) + response = call(['nmcli', '-t', '-f', 'BSSID,SIGNAL,CHAN', 'dev', 'wifi', 'list']) + for line in response.strip().split('\n'): + if not line: + continue + # nmcli escapes colons in MAC with backslashes, so split on unescaped colons + # Format: AA\:BB\:CC\:DD\:EE\:FF:SIGNAL:CHAN + parts = line.replace('\\:', '-').split(':') + if len(parts) >= 3: + bssid = parts[0].replace('-', ':') + signal = parts[1] + channel = parts[2] + try: + accesspoints.append({ + 'macAddress': bssid, + 'signalStrength': int(signal) - 100, # Convert % to approx dBm + 'channel': int(channel), + }) + except (ValueError, IndexError): + pass + return accesspoints + +def geolocate(wifiAccessPoints, url): + data = { + "considerIp": "true", + "wifiAccessPoints": wifiAccessPoints, + } + try: + r = requests.post(url, json=data, timeout=10) + result = r.json() + if 'error' in result: + print(f"Error: {result['error'].get('message', 'Unknown error')}", file=sys.stderr) + return result + except Exception: + return None + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description='Geolocate using WiFi access points') + parser.add_argument('--no-rescan', action='store_true', + help='Use cached scan results instead of triggering a new scan') + args = parser.parse_args() + + api_key = os.environ.get('GOOGLE_API_KEY') + if not api_key: + print("GOOGLE_API_KEY environment variable required", file=sys.stderr) + sys.exit(1) + + url = f'https://www.googleapis.com/geolocation/v1/geolocate?key={api_key}' + + aps = scan(rescan=not args.no_rescan) + if not aps: + print("No access points found", file=sys.stderr) + sys.exit(1) + + result = geolocate(aps, url) + if not result or 'location' not in result: + print("Geolocation failed", file=sys.stderr) + sys.exit(1) + + lat = result['location']['lat'] + lng = result['location']['lng'] + print(f"{lat},{lng}") From 987a44702413e13644e39f33553a6dfbb738e75b Mon Sep 17 00:00:00 2001 From: dheera Date: Mon, 2 Mar 2026 00:14:40 +0000 Subject: [PATCH 12/15] openclaw-launch --- dockerfiles/openclaw.dockerfile | 6 ++ openclaw-launch | 129 ++++++++++++++++++++++++++++++++ 2 files changed, 135 insertions(+) create mode 100644 dockerfiles/openclaw.dockerfile create mode 100755 openclaw-launch diff --git a/dockerfiles/openclaw.dockerfile b/dockerfiles/openclaw.dockerfile new file mode 100644 index 0000000..d1543f3 --- /dev/null +++ b/dockerfiles/openclaw.dockerfile @@ -0,0 +1,6 @@ +# syntax = edrevo/dockerfile-plus + +FROM ubuntu:noble +RUN apt-get update && apt-get install -y python3-pip +RUN apt-get install python3-arrow python3-pandas python3-numpy python3-scipy python3-tqdm python3-yaml python3-tornado python3-matplotlib curl wget -y +RUN pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu --break-system-packages diff --git a/openclaw-launch b/openclaw-launch new file mode 100755 index 0000000..ff039f0 --- /dev/null +++ b/openclaw-launch @@ -0,0 +1,129 @@ +#!/bin/bash + +# I use this script to quickly launch into docker environments with my +# home directory mounted, without fussing with docker command line args. +# (a) test things under different ROS releases quickly +# (b) stronger containerization than conda +# (c) maintain consistent, reproducible dev environments +# (d) stably work on things that require Ubuntu LTS releases so that i can run cutting-edge releases for my desktop itself +# (e) automatically use --runtime-nvidia if necessary +# (f) probably more things in the future +# +# This script will check if the image has already been launched, and if so, just run a shell in it. This allows me +# to keep docker-launching from multiple terminal windows and it will keep using the same container. +# +# The dockerfiles for all of these containers are in dockerfiles/ +# +# For example, when working on machine learning stuff I just do +# $ docker-launch ml +# +# And then when working on machine learning stuff on a CPU-only machine I just do +# $ docker-launch mlcpu +# +# When I need to test something on an older ROS release on my shiny new Ubuntu desktop I can just do +# $ docker-launch melodic +# + +# Get the directory of the script +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +PWD=`pwd` + +# Check if the argument (tag) is provided +if [ -z "$1" ]; then + echo "Usage: $0 [--rebuild]" + echo + echo "This script checks if a Docker image with the given tag exists." + echo "If the image exists, it runs bash on the container." + echo "If the image does not exist, it builds the image from .dockerfile and then runs bash on the container." + echo "Optional [--rebuild] flag forcefully rebuilds the image from .dockerfile even if the image already exists." + exit 1 +fi + +TAG=openclaw +INSTANCE=$1 + +echo Instance: $1 + +REBUILD=false + +# Check for the --rebuild option +if [ "$2" == "--rebuild" ]; then + REBUILD=true +fi + +# Function to build the Docker image +build_image() { + echo "Building Docker image from $TAG.dockerfile..." + if [ -f "$SCRIPT_DIR/dockerfiles/$TAG.dockerfile" ]; then + cd $SCRIPT_DIR/dockerfiles + DOCKER_BUILDKIT=1 docker build -t "docker_launch_$TAG$INSTANCE" -f "$SCRIPT_DIR/dockerfiles/$TAG.dockerfile" . + cd $PWD + if [ $? -ne 0 ]; then + echo "Failed to build Docker image with tag '$TAG$INSTANCE'." + exit 1 + fi + else + echo "Dockerfile '$TAG.dockerfile' does not exist." + exit 1 + fi +} + +# Function to check if the Dockerfile uses an NVIDIA base image +uses_nvidia_runtime() { + if [ -f "$SCRIPT_DIR/dockerfiles/$TAG.dockerfile" ]; then + if grep -qi '^FROM.*nvidia' "$SCRIPT_DIR/dockerfiles/$TAG.dockerfile"; then + return 0 + else + return 1 + fi + else + echo "Dockerfile '$TAG.dockerfile' does not exist." + exit 1 + fi +} + +# Check if the Docker image with the given tag exists or if rebuild is requested +if $REBUILD || ! docker image inspect "docker_launch_$TAG$INSTANCE" > /dev/null 2>&1; then + build_image +fi + +if docker ps | grep -q docker_launch_$TAG$INSTANCE +then + docker exec -it docker_launch_$TAG$INSTANCE /bin/bash +else + echo "(starting)" + docker rm docker_launch_$TAG$INSTANCE 2>/dev/null + + RUNTIME_OPTIONS="" + if uses_nvidia_runtime; then + RUNTIME_OPTIONS="--runtime nvidia" + fi + + PLATFORM_OPTIONS="" + if [[ "$OSTYPE" == linux-gnu* ]]; then + PLATFORM_OPTIONS="\ + -v $XAUTHORITY:/root/.Xauthority" + elif [[ "$OSTYPE" == darwin* ]]; then + PLATFORM_OPTIONS="" + else + echo "Unknown operating system: $OSTYPE" + fi + + DOCKER_RUN_CMD="docker run \ + -e DISPLAY=host.docker.internal:0 \ + -e DBUS_SESSION_BUS_ADDRESS \ + -v /tmp/.X11-unix:/tmp/.X11-unix \ + -v $HOME/openclaw/$INSTANCE:/home/openclaw \ + -v /fin:/fin:ro \ + --net=host \ + --name docker_launch_$TAG$INSTANCE \ + --privileged \ + $PLATFORM_OPTIONS \ + $RUNTIME_OPTIONS \ + -d \ + -it docker_launch_$TAG$INSTANCE /bin/bash" + + eval $DOCKER_RUN_CMD + docker exec -it docker_launch_$TAG$INSTANCE /bin/bash +fi + From 1d0fe7f56236461cb2b0aad5835fe6fe922c29d8 Mon Sep 17 00:00:00 2001 From: dheera Date: Wed, 8 Apr 2026 23:55:20 +0000 Subject: [PATCH 13/15] prompt --- bashrc.prompt | 64 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 58 insertions(+), 6 deletions(-) diff --git a/bashrc.prompt b/bashrc.prompt index f63200d..af46919 100644 --- a/bashrc.prompt +++ b/bashrc.prompt @@ -2,11 +2,63 @@ case "$TERM" in xterm-color|*-256color) color_prompt=yes;; esac -if [ "$color_prompt" = yes ]; then - PS1='\[\033[01;34m\]\w\[\033[00m\] \[\033[01;32m\]:)\[\033[00m\] ' -else - PS1='\w :) ' -fi +# deeper hues +__user_colors=( + 24 25 30 31 60 + 61 67 95 96 101 + 130 131 136 137 173 +) -echo +__username_color_idx() { + local s="$1" + local h=0 + local i c + for (( i=0; i<${#s}; i++ )); do + printf -v c '%d' "'${s:i:1}" + h=$(( (h * 131 + c) & 0x7fffffff )) + done + + # extra mixing so similar names separate more + h=$(( h ^ (h >> 11) ^ (h >> 19) )) + echo $(( h % ${#__user_colors[@]} )) +} + +__prompt_command() { + local uid=$EUID + local user host smile + + user=$(id -un) + host=$(hostname -s) + + if [ "$color_prompt" = yes ]; then + local PURPLE='\[\033[38;5;97m\]' + local BLUE='\[\033[38;5;67m\]' + local GREEN='\[\033[38;5;34m\]' + local RED='\[\033[38;5;160m\]' + local GREY='\[\033[38;5;242m\]' + local RESET='\[\033[0m\]' + + local idx + idx=$(__username_color_idx "$user") + local USER_COLOR="\[\033[38;5;${__user_colors[$idx]}m\]" + + if [[ $uid -eq 0 ]]; then + smile="${RED}:]${RESET}" + else + smile="${GREEN}:)${RESET}" + fi + + PS1="${USER_COLOR}${user}${RESET}${GREY}@${RESET}${PURPLE}${host}${RESET} ${BLUE}\w${RESET} ${smile} " + else + if [[ $uid -eq 0 ]]; then + smile=":]" + else + smile=":)" + fi + + PS1="${user}@${host} \w ${smile} " + fi +} + +PROMPT_COMMAND=__prompt_command From d9052f9d6f1d98dea3406a01697859645cb491d7 Mon Sep 17 00:00:00 2001 From: dheera Date: Thu, 9 Apr 2026 16:17:59 +0000 Subject: [PATCH 14/15] bashrc.all --- bashrc.all | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bashrc.all b/bashrc.all index 3012b0a..56d1348 100644 --- a/bashrc.all +++ b/bashrc.all @@ -1,6 +1,6 @@ export FOREIGN_ALIASES_SUPPRESS_SKIP_MESSAGE=True -source /home/dheera/bin/scripts/bashrc.prompt -source /home/dheera/bin/scripts/bashrc.ros -source /home/dheera/bin/scripts/bashrc.speling -source /home/dheera/bin/scripts/bashrc.shortcuts -source /home/dheera/bin/scripts/bashrc.vars +source /home/$USER/bin/scripts/bashrc.prompt +source /home/$USER/bin/scripts/bashrc.ros +source /home/$USER/bin/scripts/bashrc.speling +source /home/$USER/bin/scripts/bashrc.shortcuts +source /home/$USER/bin/scripts/bashrc.vars From 48bcbf8bdddb426724df0993ecb183e02572a193 Mon Sep 17 00:00:00 2001 From: dheera Date: Thu, 9 Apr 2026 09:22:06 -0700 Subject: [PATCH 15/15] add calculator --- bashrc.shortcuts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bashrc.shortcuts b/bashrc.shortcuts index 6287ddf..8c9b798 100644 --- a/bashrc.shortcuts +++ b/bashrc.shortcuts @@ -3,3 +3,5 @@ alias copy='xclip -selection c' alias apt-got='dpkg --get-selections' alias v='mpv --vo=tct --keep-open=yes' alias vv='mpv --vo=tct --override-display-fps=8 --cache=no --untimed --no-demuxer-thread --vd-lavc-threads=1 /dev/video0' + +calc() { python3 -c "from math import *; print($*)"; }