From a7b4e094e5e16d19b007088e7f6aecb2be9e050f Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Sun, 3 Jul 2022 18:23:44 +0200 Subject: update --- .Xresources | 13 +++++++++---- .config/i3/config | 20 +++++++++++++++----- .i3status.conf | 5 +++-- .profile | 2 ++ bin/xt | 1 + 5 files changed, 30 insertions(+), 11 deletions(-) diff --git a/.Xresources b/.Xresources index 28b8436..b3589ed 100644 --- a/.Xresources +++ b/.Xresources @@ -7,9 +7,10 @@ URxvt.colorBD: blue3 URxvt.colorUL: magenta3 URxvt.cursorColor: red ! URxvt.color12: rgb:5c/5c/ff -!URxvt.font: xft:Mono:size=12 -!URxvt.letterSpace: -1 Urxvt.font: 6x13 +!URxvt.font: xft:Mono:size=12 +!URxvt.font: xft:Mono:size=10 +URxvt.letterSpace: -1 URxvt.perl-ext-common: font-size URxvt.keysym.C-Prior: font-size:increase URxvt.keysym.C-Next: font-size:decrease @@ -18,8 +19,10 @@ URxvt.keysym.C-Next: font-size:decrease xterm*termName: xterm-256color xterm*VT100.Translations: #override \ - Meta minus: smaller-vt-font() \n\ - Meta equal: larger-vt-font() \n + Ctrl Next: smaller-vt-font() \n\ + Ctrl Prior: larger-vt-font() \n +! Meta minus: smaller-vt-font() \n\ +! Meta equal: larger-vt-font() \n xterm*cursorColor: red !xterm*visualBell: true !xterm*geometry: 100x32 @@ -32,6 +35,8 @@ xterm*decTerminalID: vt340 xterm*allowWindowOps : False xterm*disallowedWindowOps : 1,2,3,4,5,6,7,8,9,11,13,18,19,20,21,GetSelection,SetSelection,SetWinLines,SetXprop +! Colors optimized for a light background +! ! Black + DarkGrey *color0: #000000 *color8: #555753 diff --git a/.config/i3/config b/.config/i3/config index 48c461c..c78f84b 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -59,6 +59,8 @@ bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOU # enable floating mode for_window [class="Arandr"] floating enable for_window [class="Brave-browser"] floating enable +for_window [class="Blueberry.py"] floating enable +for_window [class="Blueman-manager"] floating enable for_window [class="Chromium"] floating enable for_window [title="Task Manager - Chromium"] floating enable for_window [title="Gestionnaire de tâches – Chromium"] floating enable @@ -67,7 +69,8 @@ for_window [class="discord"] floating enable for_window [class="Display"] floating enable for_window [class="Feedreader"] floating enable for_window [class="feh"] floating enable -for_window [class="firefox"] floating enable +#for_window [class="firefox"] floating enable +for_window [class="fluent-reader"] floating enable border normal for_window [class="Geeqie"] floating enable for_window [class="Gpicview"] floating enable for_window [class="Ghb"] floating enable @@ -76,17 +79,22 @@ for_window [class="gnuplot_qt"] floating enable for_window [instance="gxditview"] floating enable for_window [class="Keybase"] floating enable for_window [class="libreoffice"] floating enable +for_window [class="Liferea"] floating enable for_window [class="llpp"] floating enable for_window [class="MuPDF"] floating enable +for_window [class="Org.gnome.Software"] floating enable for_window [class="Pavucontrol"] floating enable -for_window [class="Slack"] floating enable +for_window [title="QEMU"] floating enable +for_window [class="RSS Guard"] floating enable for_window [class="Signal"] floating enable +for_window [class="Slack"] floating enable for_window [class="Spotify"] floating enable for_window [class="Thunderbird"] floating enable for_window [class="vlc"] floating enable for_window [instance="wish"] floating enable for_window [class="wpa_gui"] floating enable for_window [class="XVroot"] floating enable +#for_window [class="XTerm"] floating enable for_window [class="zoom"] floating enable bindsym button3 floating toggle @@ -103,15 +111,17 @@ bindsym $mod+w kill bindsym --release button2 kill # start dmenu (a program launcher) -#bindsym $mod+d exec dmenu_run +bindsym $mod+d exec dmenu_run # There also is the (new) i3-dmenu-desktop which only displays applications # shipping a .desktop file. It is a wrapper around dmenu, so you need that # installed. #bindsym $mod+d exec --no-startup-id i3-dmenu-desktop -dmenu="dmenu -i -fn 'Mono-9'" #bindsym F1 exec --no-startup-id i3-dmenu-desktop -dmenu="dmenu -i -fn 'Mono-9'" -bindsym $mod+d exec --no-startup-id i3-dmenu-desktop +#bindsym $mod+d exec --no-startup-id i3-dmenu-desktop #bindsym F1 exec --no-startup-id i3-dmenu-desktop -entry-type=command -bindsym F1 exec --no-startup-id i3-dmenu-desktop -dmenu="dmenu -i -fn 'Fixed-12'" +#bindsym F1 exec --no-startup-id i3-dmenu-desktop -dmenu="dmenu -i -fn 'Fixed-12'" +#bindsym F1 exec --no-startup-id i3-dmenu-desktop -dmenu="dmenu -i -fn 'xft:fixed:style=bold:pixelsize=12'" +bindsym F1 exec --no-startup-id i3-dmenu-desktop -dmenu="dmenu -i -fn 'MiscFixedSC613-9'" # Use playerctl to control media player from keyboard bindsym XF86AudioPlay exec --no-startup-id playerctl play-pause diff --git a/.i3status.conf b/.i3status.conf index 87656f8..9570b48 100644 --- a/.i3status.conf +++ b/.i3status.conf @@ -46,7 +46,7 @@ ethernet _first_ { battery all { last_full_capacity = true integer_battery_capacity = true - format = "%status %percentage %remaining" + format = "%status %percentage %remaining %consumption" status_chr = "⚡🔋" status_bat = "🔋" status_unk = "? UNK" @@ -93,8 +93,9 @@ memory { cpu_temperature 0 { format = "🌡%degrees °C" #path = "/sys/class/hwmon/hwmon0/temp1_input" + #path = "/sys/class/hwmon/hwmon6/temp1_input" #path = "/sys/class/hwmon/hwmon7/temp1_input" - path = "/sys/class/hwmon/hwmon6/temp1_input" + #path = "/sys/class/hwmon/hwmon8/temp1_input" } tztime local { diff --git a/.profile b/.profile index deb8145..1d05d72 100644 --- a/.profile +++ b/.profile @@ -7,6 +7,8 @@ PATH=~/bin:$PATH:~/go/bin eval "$(gh completion -s bash)" } +alias dotfiles='git --git-dir=$HOME/dotfiles --work-tree=$HOME' + # Last action: auto start X11 when logged on first console #case $HOSTNAME in #([sS]wift|yoda) [ "$(tty)" != /dev/tty1 ] || exec startx ;; diff --git a/bin/xt b/bin/xt index 9395b3e..98f6ac6 100755 --- a/bin/xt +++ b/bin/xt @@ -2,4 +2,5 @@ #exec xterm -sl 500 -j -cr red "$@" & exec xterm "$@" & #cmd="urxvtc ${@:--T $HOSTNAME}" +#cmd="urxvtc $@" #eval "$cmd" || { [ $? = 2 ] && urxvtd -q -o -f && eval "$cmd"; } -- cgit v1.2.3 From 16ef691e5632bc250f478f4b453eed3b2bb38713 Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Wed, 13 Jul 2022 12:41:51 +0200 Subject: update --- bin/wag | 288 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 288 insertions(+) create mode 100755 bin/wag diff --git a/bin/wag b/bin/wag new file mode 100755 index 0000000..d6e3121 --- /dev/null +++ b/bin/wag @@ -0,0 +1,288 @@ +#!/bin/sh + +## wag is a tool to generate static web sites + +unset CDPATH +export LC_ALL=C IFS=' +' + +cmd=$(command -v "$0") + +## help prints this program documentation +help() { awk '/^## / {print substr($0, 4)}' "$cmd"; } + +lipsum='Lorem ipsum dolor sit amet, consectetur adipiscing elit, +sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. +Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris +nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in +reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla +pariatur. Excepteur sint occaecat cupidatat non proident, sunt in +culpa qui officia deserunt mollit anim id est laborum.' + +# An overly simplified http request parser for static web sites. +http_request() { + read -r cmd uri proto + case $uri in */) uri="${uri}index.html" ;; esac + while true; do + read -r line || break + [ ${#line} = 0 ] && break + done + printf 'HTTP/1.1 200 OK\n\n' && cat "${uri#/}" +} + +md2h() { want="$2" got=$(echo "$1" | md2html -); } + +md2html() { + tmp=$(mktemp -u) + trap "rm -f '$tmp'" EXIT + { + cat "${1:--}" | tee "$tmp" | awk '/^[ ]*\[[^]]+\]:/' + cat "$tmp" + } | + awk ' + function newblock(nblock) { + if (text) + print "<" block ">" text "" + text = "" + out = 1 + block = nblock ? nblock : "p" + } + + function subinline(tgl, inl) { + while (match($0, tgl)) { + if (inline[ni] == inl) + ni -= sub(tgl, "") + else if (sub(tgl, "<" inl ">")) + inline[++ni] = inl + } + } + + function dolink(href, lnk) { + # Undo escaped html in uris + gsub(/&/, "\\&", href) + gsub(/</, "<", href) + gsub(/>/, ">", href) + # & can be tricky, and not standard: + gsub(/&/, "\\\\\\&", href) + gsub(/&/, "\\\\\\&", lnk) + return "" lnk "" + } + + BEGIN { + ni = 0 # inlines + nl = 0 # nested lists + out = 0 # 0 if no output so far + text = "" + block = "p" + } + + # Skip front matter. + out == 0 && $0 == "---" { + do + getline + while ($0 != "---") + next + } + + # Escape HTML. + esc != "false" { + gsub("&", "\\&") + gsub("<", "\\<") + gsub(">", "\\>") + } + + # Internal references. + match($0, /^[ ]*\[[^]]+\]:/) > 0 { + k = substr($0, RSTART+1, RLENGTH-3) + v = substr($0, RLENGTH+1) + sub(/^[ ]/, "", v) + sub(/[ ]$/, "", v) + ref[substr($0, RSTART+1, RLENGTH-3)] = v + next + } + + # Horizontal rules. + /^[ ]*([-*_] ?)+[ ]*$/ && text == "" { + print "
" + next + } + + # Tables. Syntax: + # Right Align| Center Align |Left Align + /([ ]\|)|(\|[ ])/ { + if (block != "table") + newblock("table") + nc = split($0, cells, "|") + $0 = "\n" + for (i = 1; i <= nc; i++) { + align = "left" + if (sub(/^[ ]+/, "", cells[i])) { + if (sub(/[ ]+$/, "", cells[i])) + align = "center" + else + align = "right" + } + sub(/[ ]+$/, "", cells[i]) + $0 = $0 "" cells[i] "\n" + } + $0 = $0 "" + } + + # Ordered and unordered (possibly nested) lists. + /^[ ]*([*+-]|(([0-9]+[.-]?)+))[ ]/ { + newblock("li") + nnl = 1 + while (match($0, /^[ ]/)) { + sub(/^[ ]/, "") + nnl++ + } + while (nl > nnl) + print "" + while (nl < nnl) { + list[++nl] = "ol" + if (match($0, /^[*+-]/)) + list[nl] = "ul" + print "<" list[nl] ">" + } + sub(/^([*+-]|(([0-9]+[.-]?)+))[ ]/, "") + } + + # Multi line list items. + block == "li" { + sub(/^( *)|( *)/, "") + } + + # Code blocks. + /^( | )/ { + if (block != "code") + newblock("code") + sub(/^( | )/, "") + text = text $0 "\n" + next + } + + # Paragraphs. + /^$/ { + newblock() + while (nl > 0) + print "" + } + + # Headers. + /^#+ / { + newblock() + match($0, /#+/) + n = RLENGTH + if (n > 6) + n = 6 + text = substr($0, RLENGTH + 1) + sub(/^ */, "", text) + block = "h" n + next + } + + # Alternate headers (underlined). + /^=+$/ { + block = "h" 1 + next + } + + /^-+$/ { + block = "h" 2 + next + } + + { + # Images. + while (match($0, /!\[[^]]+\]\([^)]+\)/)) { + split(substr($0, RSTART, RLENGTH), a, /(!\[)|\)|(\]\()/) + sub(/!\[[^]]+\]\([^)]+\)/, "\""") + } + # Links. + while (match($0, /\[[^]]+\]\([^)]+\)/)) { + split(substr($0, RSTART, RLENGTH), a, /[[)]|(\]\()/) + sub(/\[[^]]+\]\([^)]+\)/, dolink(a[3], a[2])) + } + # Internal references. + while (match($0, /\[[^]]+\]/)) { + k = substr($0, RSTART+1, RLENGTH-2) + sub(/\[[^]]+\]/, dolink(ref[k], k)) + } + # Auto links (uri matching is poor). + na = split($0, a, /(^\()|[ ]|([,.)]([ ]|$))/) + for (i = 1; i <= na; i++) + if (match(a[i], /^(((https?|ftp|file|news|irc):\/\/)|(mailto:)).+$/)) + sub(a[i], dolink(a[i], a[i])) + # Inline. + subinline("(\\*\\*)|(__)", "strong") + subinline("\\*", "em") + subinline("`", "code") + text = text (text ? " " : "") $0 + } + + END { + while (ni > 0) + text = text "" + newblock() + while (nl > 0) + print "" + }' +} + +serve() { while true; do nc -l -p 1500 -e "$cmd http_request"; done; } + +test() { + fail=0 pass=0 skip=0 tfilter="$*" + + test_run md2h 'abc __def__ ghi' '

abc def ghi

' + test_run md2h 'abc **def** ghi' '

abc def ghi

' + test_run md2h 'abc *def* ghi' '

abc def ghi

' + test_run md2h 'abc ***def*** ghi' '

abc def ghi

' + test_run md2h 'abc `def` ghi' '

abc def ghi

' + test_run md2h '# h1' '

h1

' + test_run md2h '## h2' '

h2

' + test_run md2h 'h1 +==' '

h1

' + test_run md2h 'h2 +--' '

h2

' + test_run md2h 'abc [github] def' '

abc github def

' + test_run md2h 'abc [github](https://github.com) def' '

abc github def

' + test_run md2h 'abc [github] def + +[github]: https://github.com' '

abc github def

' + test_run md2h '--- +Title: front matter test +--- + +Hello [world]. + +--- +Bye. + +[world]: http://example.com' '

Hello world.

+
+

Bye.

' + + echo "Total: $((pass + fail + skip)), Passed: $pass, Failed: $fail, Skip: $skip" + return "$fail" +} + +test_run() { + eval "test_$1=\$((test_$1 + 1)); ti=\"\$test_$1\"" + [ "$tfilter" ] && + case "$1#$ti" in + $tfilter) ;; + *) skip=$((skip + 1)); return 0 ;; + esac + "$@" + [ "$got" = "$want" ] && { + pass=$((pass + 1)) + return 0 + } + fail=$((fail + 1)) + printf "%s FAIL\n Got: %s\n Want: %s\n" "$1#$ti" "$got" "$want" >&2 + return 1 +} + +# Execute command line +[ "$1" ] || help && "$@" -- cgit v1.2.3 From fdf9f492e04870da59f180bbaffedf610952bfd0 Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Sat, 24 Sep 2022 17:09:15 +0200 Subject: update --- .bashrc | 2 +- .config/i3/config | 6 +++--- .profile | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.bashrc b/.bashrc index 56ba669..2a3d2d4 100644 --- a/.bashrc +++ b/.bashrc @@ -63,7 +63,7 @@ alias gtb='go test -v -cpuprofile cpu.out -memprofile mem.out -benchmem -bench' alias rvi='sudo vim' alias rxt='sudo xt' alias rxvi='sudo xvi' -alias ww='vi ~/Wiki/HomePage' +alias ww='vi ~/Wiki/home_page.md' alias dotfiles='git --git-dir=$HOME/dotfiles --work-tree=$HOME' alias uc='systemctl --user' diff --git a/.config/i3/config b/.config/i3/config index c78f84b..00255b3 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -61,9 +61,9 @@ for_window [class="Arandr"] floating enable for_window [class="Brave-browser"] floating enable for_window [class="Blueberry.py"] floating enable for_window [class="Blueman-manager"] floating enable -for_window [class="Chromium"] floating enable -for_window [title="Task Manager - Chromium"] floating enable -for_window [title="Gestionnaire de tâches – Chromium"] floating enable +#for_window [class="Chromium"] floating enable +#for_window [title="Task Manager - Chromium"] floating enable +#for_window [title="Gestionnaire de tâches – Chromium"] floating enable for_window [instance="DOTTY"] floating enable for_window [class="discord"] floating enable for_window [class="Display"] floating enable diff --git a/.profile b/.profile index 1d05d72..fadd6d8 100644 --- a/.profile +++ b/.profile @@ -4,10 +4,10 @@ PATH=~/bin:$PATH:~/go/bin [ "${SHELL##*/}" = bash ] && { . ~/.bashrc - eval "$(gh completion -s bash)" + # eval "$(gh completion -s bash)" } -alias dotfiles='git --git-dir=$HOME/dotfiles --work-tree=$HOME' +# alias dotfiles='git --git-dir=$HOME/dotfiles --work-tree=$HOME' # Last action: auto start X11 when logged on first console #case $HOSTNAME in -- cgit v1.2.3 From 4bba38ec61e0aba340ea885f2b85ace465735eca Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Wed, 28 Sep 2022 18:29:24 +0200 Subject: update --- bin/w3 | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 bin/w3 diff --git a/bin/w3 b/bin/w3 new file mode 100755 index 0000000..90cc29c --- /dev/null +++ b/bin/w3 @@ -0,0 +1,6 @@ +#!/bin/sh + +cols=$(stty -a|awk -F "[ ;]" '{print $9; exit}') +[ $cols -gt 72 ] && stty cols 72 +w3m "${@:-https://ddg.gg/lite/}" +stty cols "$cols" -- cgit v1.2.3