From 9a878b2b6f94f955ca6caf9b44fb947635da67f1 Mon Sep 17 00:00:00 2001 From: Mitsuo Tokumori Date: Tue, 1 Jul 2025 15:29:27 +0900 Subject: Add snippet.sh --- public/.bashrc | 2 ++ public/.local/bin/audio_control.sh | 5 +++++ public/.local/bin/dmenu-webshortcuts.sh | 3 ++- public/.local/bin/laptop-xrandr.sh | 16 ++++++++++++++-- public/.local/share/dmenu/snippet/htmlEscape.js | 9 +++++++++ public/.local/share/dmenu/snippet/test.sh | 1 + public/.local/share/dmenu/snippet/wikitable.wiki | 13 +++++++++++++ public/etc/X11/xorg.conf.d/10-extensions.conf | 4 ++++ 8 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 public/.local/share/dmenu/snippet/htmlEscape.js create mode 100644 public/.local/share/dmenu/snippet/test.sh create mode 100644 public/.local/share/dmenu/snippet/wikitable.wiki create mode 100644 public/etc/X11/xorg.conf.d/10-extensions.conf (limited to 'public') diff --git a/public/.bashrc b/public/.bashrc index bf832ac..bfc3a43 100644 --- a/public/.bashrc +++ b/public/.bashrc @@ -115,6 +115,8 @@ eval "$(dircolors)" # container directory for many python venv export PYTHON_VENVS="$XDG_DATA_HOME/python/venvs" +# use the simple interactive terminal, the "advanced" one does not support vim input +export PYTHON_BASIC_REPL=1 # Extra programs # -------------- diff --git a/public/.local/bin/audio_control.sh b/public/.local/bin/audio_control.sh index a257120..b930a88 100755 --- a/public/.local/bin/audio_control.sh +++ b/public/.local/bin/audio_control.sh @@ -1,5 +1,10 @@ #!/bin/bash +# TODO: +# Create dmenu script that allows changing the default sink and source. +# pactl list sources short +# pactl list sinks short + delta=${2:-10} signal=10 diff --git a/public/.local/bin/dmenu-webshortcuts.sh b/public/.local/bin/dmenu-webshortcuts.sh index 5ab4f82..411525d 100755 --- a/public/.local/bin/dmenu-webshortcuts.sh +++ b/public/.local/bin/dmenu-webshortcuts.sh @@ -53,6 +53,7 @@ case "$keyword" in "python") xdg-open "https://docs.python.org/3/search.html?q=${search_term// /+}" ;; "pypi") xdg-open "https://pypi.org/search/?q=${search_term// /+}&o=" ;; "npm") xdg-open "https://www.npmjs.com/search?q=${search_term// /+}" ;; + "mdn") xdg-open "https://developer.mozilla.org/en-US/search?q=${search_term// /+}" ;; # Media "yt") xdg-open "https://www.youtube.com/results?search_query=$search_term" ;; @@ -83,7 +84,7 @@ case "$keyword" in "rae") xdg-open "https://dle.rae.es/?w=$search_term" ;; # Mitsuo - "pw") xdg-open "http://wiki.pulse15/index.php?search=${search_term// /+}" ;; + "pw") xdg-open "http://wiki.localhost/index.php?search=${search_term// /+}" ;; "factorio") xdg-open "https://wiki.factorio.com/${search_term// /_}" ;; "dst") xdg-open "https://dontstarve.wiki.gg/wiki/${search_term// /_}" ;; "mc") xdg-open "https://minecraft.wiki/w/${search_term// /_}" ;; diff --git a/public/.local/bin/laptop-xrandr.sh b/public/.local/bin/laptop-xrandr.sh index 5d8d422..cd3a66f 100755 --- a/public/.local/bin/laptop-xrandr.sh +++ b/public/.local/bin/laptop-xrandr.sh @@ -22,5 +22,17 @@ simple_2_monitor() { #simple_2_monitor #xrandr --auto --output HDMI-A-0 --mode 1920x1080 --right-of eDP -# Only HDMI output 4k -xrandr --output eDP --off --output HDMI-A-0 --mode 3840x2160 +only_hdmi_4k() { + xrandr --output eDP --off --output HDMI-A-0 --mode 3840x2160 +} + +only_hdmi_2k() { + xrandr --output eDP --off --output HDMI-A-0 --mode 1920x1080 +} + +case $1 in + 4k) only_hdmi_4k ;; + 2k) only_hdmi_2k ;; + reset) xrandr ;; + *) only_hdmi_4k +esac diff --git a/public/.local/share/dmenu/snippet/htmlEscape.js b/public/.local/share/dmenu/snippet/htmlEscape.js new file mode 100644 index 0000000..f4a3673 --- /dev/null +++ b/public/.local/share/dmenu/snippet/htmlEscape.js @@ -0,0 +1,9 @@ +/* https://stackoverflow.com/questions/7381974/which-characters-need-to-be-escaped-in-html#7382028 */ +function htmlEscape(text) { + return String(text) + .replaceAll("&", "&") + .replaceAll("<", "<") + .replaceAll(">", ">") + .replaceAll('"', """) + .replaceAll("'", "'"); +} diff --git a/public/.local/share/dmenu/snippet/test.sh b/public/.local/share/dmenu/snippet/test.sh new file mode 100644 index 0000000..fcadfe3 --- /dev/null +++ b/public/.local/share/dmenu/snippet/test.sh @@ -0,0 +1 @@ +[ 0 -eq 1 ] && echo True || echo False diff --git a/public/.local/share/dmenu/snippet/wikitable.wiki b/public/.local/share/dmenu/snippet/wikitable.wiki new file mode 100644 index 0000000..4d05d14 --- /dev/null +++ b/public/.local/share/dmenu/snippet/wikitable.wiki @@ -0,0 +1,13 @@ +{| class="wikitable sortable" +|+ Meteorological seasons +|- +! Northern hemisphere !! Southern hemisphere !! Start date +|- +| Winter || Summer || 12月1日 +|- +| Spring || Autumn (aka: Fall) || 3月1日 +|- +| Summer || Winter || 6月1日 +|- +| Autumn (aka: Fall) || Spring || 9月1日 +|} diff --git a/public/etc/X11/xorg.conf.d/10-extensions.conf b/public/etc/X11/xorg.conf.d/10-extensions.conf new file mode 100644 index 0000000..720f85e --- /dev/null +++ b/public/etc/X11/xorg.conf.d/10-extensions.conf @@ -0,0 +1,4 @@ +# https://wiki.archlinux.org/title/Display_Power_Management_Signaling +Section "Extensions" + Option "DPMS" "false" +EndSection -- cgit v1.2.3