aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.config/gdb/gdbinit5
-rw-r--r--.config/gdb/gdbinit.py3
-rwxr-xr-x.local/share/bin/clean3
-rwxr-xr-x.local/share/bin/lf23
-rwxr-xr-x.local/share/bin/venvgen47
-rw-r--r--.local/share/fcitx5/themes/mode/base.conf42
-rwxr-xr-x.local/share/mode/switch.d/fcitx52
7 files changed, 122 insertions, 3 deletions
diff --git a/.config/gdb/gdbinit b/.config/gdb/gdbinit
index bf4a25d..4c61733 100644
--- a/.config/gdb/gdbinit
+++ b/.config/gdb/gdbinit
@@ -13,9 +13,14 @@ set extended-prompt \P
set history save on
set history size 10000000
set history remove-duplicates 100
+set style emoji off
# aliases
alias reset = monitor reset
+alias -a -- v8m = arm-v8m
+alias -a -- v8m tz = arm-v8m trustzone
+alias -a -- jlink sv = jlink server
+alias -a -- jlink sv wd = jlink server watchdog
# commands
alias mk = !mk
diff --git a/.config/gdb/gdbinit.py b/.config/gdb/gdbinit.py
index 1a137c5..7888a37 100644
--- a/.config/gdb/gdbinit.py
+++ b/.config/gdb/gdbinit.py
@@ -1,7 +1,7 @@
import gdb
import gdb.prompt
-from subprocess import DEVNULL, check_output
+from subprocess import check_output
from os import environ
class TryCommand(gdb.Command):
@@ -50,4 +50,3 @@ def new_substitute_prompt(prompt: str):
return out
gdb.prompt.substitute_prompt = new_substitute_prompt
-
diff --git a/.local/share/bin/clean b/.local/share/bin/clean
new file mode 100755
index 0000000..8c824f1
--- /dev/null
+++ b/.local/share/bin/clean
@@ -0,0 +1,3 @@
+#!/bin/sh
+[ -n "$UB_SOCKET" ] && ueberzugpp cmd --socket "$UB_SOCKET" --action remove --identifier PREVIEW
+
diff --git a/.local/share/bin/lf b/.local/share/bin/lf
new file mode 100755
index 0000000..430ae0b
--- /dev/null
+++ b/.local/share/bin/lf
@@ -0,0 +1,23 @@
+#!/bin/sh
+lf=/usr/bin/lf
+
+UB_PID=0
+UB_SOCKET=""
+UB_PID_FILE="$(mktemp)"
+
+cleanup() {
+ exec 3>&-
+ ueberzugpp cmd -s "$UB_SOCKET" -a exit
+}
+
+# don't try to use ueberzug over ssh
+[ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ] && exec $lf "$@"
+
+ueberzugpp layer --silent --no-stdin --use-escape-codes --pid-file "$UB_PID_FILE" >/dev/null
+UB_PID="$(cat "$UB_PID_FILE")"
+rm -f "$UB_PID_FILE"
+UB_SOCKET="/tmp/ueberzugpp-$UB_PID.socket"
+export UB_PID UB_SOCKET
+trap cleanup HUP INT QUIT TERM EXIT
+$lf "$@" 3>&-
+
diff --git a/.local/share/bin/venvgen b/.local/share/bin/venvgen
new file mode 100755
index 0000000..25f2c78
--- /dev/null
+++ b/.local/share/bin/venvgen
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+# check if the input is valid
+for arg in "$@" ; do
+ case "$arg" in
+ *=*) ;;
+ *)
+ echo "error: missing assignment operator in argument ($arg)" >&2
+ exit 1
+ ;;
+ esac
+done
+
+# shebang
+printf '#!/bin/sh\n'
+
+# save old variables
+for arg in "$@" ; do
+ name="${arg%%=*}"
+ eval "hasval=\${$name+x}"
+ [ -n "$hasval" ] && printf '_%s="${%s}"\n' "$name" "$name"
+done
+
+# set new variables
+for arg in "$@" ; do
+ name="${arg%%=*}"
+ value="${arg#*=}"
+ printf 'export %s=%q\n' "$name" "$value"
+done
+
+# deactivate function
+printf 'deactivate() {\n'
+for arg in "$@" ; do
+ name="${arg%%=*}"
+ eval "hasval=\${$name+x}"
+ if [ -n "$hasval" ] ; then
+ printf '\t%s="${_%s}"\n' "$name" "$name"
+ printf '\tunset -v _%s\n' "$name"
+ else
+ printf '\tunset -v %s\n' "$name"
+ fi
+done
+printf '\thash -r 2>/dev/null\n'
+printf '\tunset -f deactivate\n'
+printf '}\n'
+printf 'hash -r 2>/dev/null\n'
+
diff --git a/.local/share/fcitx5/themes/mode/base.conf b/.local/share/fcitx5/themes/mode/base.conf
new file mode 100644
index 0000000..e329a4f
--- /dev/null
+++ b/.local/share/fcitx5/themes/mode/base.conf
@@ -0,0 +1,42 @@
+# vim:ft=dosini
+[Metadata]
+Name=mode
+Version=0.1
+Author=lonkaars
+Description=theme generated by mode
+ScaleWithDPI=True
+
+[InputPanel]
+Font=sans-serif 12
+
+[InputPanel/Background/Margin]
+Left=0
+Right=0
+Top=0
+Bottom=0
+
+[Menu/Background/Margin]
+Left=0
+Right=0
+Top=0
+Bottom=0
+
+[Menu/ContentMargin]
+Left=0
+Right=0
+Top=0
+Bottom=0
+
+[Menu/Highlight/Margin]
+Left=0
+Right=0
+Top=0
+Bottom=0
+
+[Menu/TextMargin]
+Left=0
+Right=0
+Top=0
+Bottom=0
+
+
diff --git a/.local/share/mode/switch.d/fcitx5 b/.local/share/mode/switch.d/fcitx5
index d9d0032..2cc6ccb 100755
--- a/.local/share/mode/switch.d/fcitx5
+++ b/.local/share/mode/switch.d/fcitx5
@@ -1,7 +1,7 @@
#!/bin/sh
[ $no_cfg -eq 1 ] && return
-mkcd "$XDG_DATA_HOME/fcitx5/themes/default"
+mkcd "$XDG_DATA_HOME/fcitx5/themes/mode"
rounding=6
size=$(( 2 * $rounding + 4 ))
margin_h=6