From ef6ddd1de3f39623d3c7bfa8ec4c616ac6b9fae2 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 23 Jan 2023 16:43:21 +0100 Subject: tv firefox: MOZ_USE_XINPUT2=1 when TOUCHSCREEN==1 --- tv/5pkgs/simple/ff.nix | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tv/5pkgs/simple') diff --git a/tv/5pkgs/simple/ff.nix b/tv/5pkgs/simple/ff.nix index 4ce9c3c75..b6022c6ca 100644 --- a/tv/5pkgs/simple/ff.nix +++ b/tv/5pkgs/simple/ff.nix @@ -1,5 +1,8 @@ { pkgs }: pkgs.writeDashBin "ff" '' + case $TOUCHSCREEN in 1) + export MOZ_USE_XINPUT2=1 + esac exec ${pkgs.firefox}/bin/firefox "$@" '' -- cgit v1.2.3 From 1499d5c3934e873041069d6b84bb4704beb83ead Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 27 Jan 2023 13:08:31 +0100 Subject: tv iosevka 1: streamline package --- tv/5pkgs/simple/alacritty-tv.nix | 8 ++++---- tv/5pkgs/simple/iosevka-tv-1.nix | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'tv/5pkgs/simple') diff --git a/tv/5pkgs/simple/alacritty-tv.nix b/tv/5pkgs/simple/alacritty-tv.nix index 1c7730a71..6c2f49db0 100644 --- a/tv/5pkgs/simple/alacritty-tv.nix +++ b/tv/5pkgs/simple/alacritty-tv.nix @@ -53,10 +53,10 @@ let window.dimensions.lines = 9; }; variants.hidpi = { - font.normal.family = "iosevka-tv-1"; - font.bold.family = "iosevka-tv-1"; - font.italic.family = "iosevka-tv-1"; - font.bold_italic.family = "iosevka-tv-1"; + font.normal.family = "iosevka tv 1"; + font.bold.family = "iosevka tv 1"; + font.italic.family = "iosevka tv 1"; + font.bold_italic.family = "iosevka tv 1"; font.size = 5; key_bindings = [ { key = "Up"; mods = "Control"; action = "IncreaseFontSize"; } diff --git a/tv/5pkgs/simple/iosevka-tv-1.nix b/tv/5pkgs/simple/iosevka-tv-1.nix index f72565bc7..0f8b4d4b2 100644 --- a/tv/5pkgs/simple/iosevka-tv-1.nix +++ b/tv/5pkgs/simple/iosevka-tv-1.nix @@ -3,7 +3,7 @@ pkgs.iosevka.override { # https://typeof.net/Iosevka/customizer privateBuildPlan = { - family = "iosevka-tv-1"; + family = "iosevka tv 1"; spacing = "term"; serifs = "sans"; export-glyph-names = true; @@ -14,5 +14,5 @@ pkgs.iosevka.override { widths.normal.menu = 5; widths.normal.css = "normal"; }; - set = "iosevka-tv-1"; + set = "tv-1"; } -- cgit v1.2.3 From 09c1d8ce2eef60835b48b6f9826467860edfad86 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 27 Jan 2023 13:10:35 +0100 Subject: tv iosevka 2: init at 15.6.3 --- tv/5pkgs/simple/iosevka-tv-2.nix | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tv/5pkgs/simple/iosevka-tv-2.nix (limited to 'tv/5pkgs/simple') diff --git a/tv/5pkgs/simple/iosevka-tv-2.nix b/tv/5pkgs/simple/iosevka-tv-2.nix new file mode 100644 index 000000000..888ba6a0c --- /dev/null +++ b/tv/5pkgs/simple/iosevka-tv-2.nix @@ -0,0 +1,20 @@ +{ pkgs }: + +pkgs.iosevka.override { + # https://typeof.net/Iosevka/customizer + privateBuildPlan = { + family = "iosevka tv 2"; + spacing = "term"; + serifs = "sans"; + export-glyph-names = true; + no-ligation = true; + no-cv-ss = false; + + variants.inherits = "ss10"; + + widths.normal.shape = 600; + widths.normal.menu = 5; + widths.normal.css = "normal"; + }; + set = "tv-2"; +} -- cgit v1.2.3 From 895206d5c319418120f924db2fdaaaf188a66223 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Jan 2023 13:11:55 +0100 Subject: tv q: simplify calendar --- tv/5pkgs/simple/q/default.nix | 65 +++++++++++++------------------------------ 1 file changed, 20 insertions(+), 45 deletions(-) (limited to 'tv/5pkgs/simple') diff --git a/tv/5pkgs/simple/q/default.nix b/tv/5pkgs/simple/q/default.nix index 2ae71db52..eb8462d57 100644 --- a/tv/5pkgs/simple/q/default.nix +++ b/tv/5pkgs/simple/q/default.nix @@ -10,53 +10,28 @@ let hspace = 2; # Return number of columns required to print n calenders side by side. - need_width = n: - assert n >= 1; - n * calwidth + (n - 1) * hspace; - - pad = /* sh */ ''{ - ${pkgs.gnused}/bin/sed ' - # rtrim - s/ *$// - - # delete last empty line - ''${/^$/d} - ' \ - | ${pkgs.gawk}/bin/awk '{printf "%-${toString calwidth}s\n", $0}' \ - | ${pkgs.gnused}/bin/sed ' - # colorize header - 1,2s/.*/&/ - - # colorize week number - s/^[ 1-9][0-9]/&/ - ' - }''; + need_width = n: assert n >= 1; n * calwidth + (n - 1) * hspace; + in /* sh */ '' cols=$(${pkgs.ncurses}/bin/tput cols) - ${pkgs.coreutils}/bin/paste \ - <(if test $cols -ge ${toString (need_width 3)}; then - ${pkgs.utillinux}/bin/cal -mw \ - $(${pkgs.coreutils}/bin/date +'%m %Y' -d 'last month') \ - | ${pad} - fi) \ - <(if test $cols -ge ${toString (need_width 1)}; then - ${pkgs.utillinux}/bin/cal -mw \ - | ${pkgs.gnused}/bin/sed ' - # colorize day of month - s/\(^\| \)'"$(${pkgs.coreutils}/bin/date +%e)"'\>/&/ - ' \ - | ${pad} - fi) \ - <(if test $cols -ge ${toString (need_width 2)}; then - ${pkgs.utillinux}/bin/cal -mw \ - $(${pkgs.coreutils}/bin/date +'%m %Y' -d 'next month') \ - | ${pad} - fi) \ - | ${pkgs.gnused}/bin/sed ' - s/^\t// - s/\t$// - s/\t/${lpad hspace " " ""}/g - ' + if test $cols -ge ${toString (need_width 3)}; then + ${pkgs.utillinux}/bin/cal --color=always -mw3 + elif test $cols -ge ${toString (need_width 2)}; then + ${pkgs.utillinux}/bin/cal --color=always -mw -n 2 + elif test $cols -ge ${toString (need_width 1)}; then + ${pkgs.utillinux}/bin/cal --color=always -mw1 + else + : + fi | + ${pkgs.gnused}/bin/sed -r ' + # dim week numbers + s/((^ *| )[ 1-5][0-9]( *)?)(([ 1-3][0-9])*)/\1\4/g + # dim month and day names + s/^ *[A-Z].*/&/ + # highlight current date + s/\[7m// + s/\[27m// + ' ''; q-isodate = /* sh */ '' -- cgit v1.2.3 From bfa64c08ae82c609cde9791491bc0cc4d3dec929 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Jan 2023 13:13:19 +0100 Subject: tv q: streamline dates and use RGB --- tv/5pkgs/simple/q/default.nix | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'tv/5pkgs/simple') diff --git a/tv/5pkgs/simple/q/default.nix b/tv/5pkgs/simple/q/default.nix index eb8462d57..a7a149ddc 100644 --- a/tv/5pkgs/simple/q/default.nix +++ b/tv/5pkgs/simple/q/default.nix @@ -34,22 +34,20 @@ let ' ''; - q-isodate = /* sh */ '' + q-isodate = TZ: color: /* sh */ '' + TZ=${shell.escape TZ} \ ${pkgs.coreutils}/bin/date \ - '+%Y-%m-%dT%H:%M:%S%:z' + '+%Y-%m-%dT[;'${shell.escape color}'m%H:%M:%S%:z' ''; + q-deudate = q-isodate "Europe/Berlin" "38;5;085"; + # Singapore's red is #ED2E38 - q-sgtdate = /* sh */ '' - TZ=Asia/Singapore \ - ${pkgs.coreutils}/bin/date \ - '+%Y-%m-%dT%H:%M:%S%:z' - ''; + q-sgtdate = q-isodate "Asia/Singapore" "38;2;237;46;56"; - q-utcdate = /* sh */ '' - ${pkgs.coreutils}/bin/date -u \ - '+%Y-%m-%dT%H:%M:%S%:z' - ''; + q-thadate = q-isodate "Asia/Bangkok" "38;5;226"; + + q-utcdate = q-isodate "UTC" "38;5;065"; q-gitdir = /* sh */ '' if test -d .git; then @@ -148,7 +146,7 @@ pkgs.writeBashBin "q" '' export PATH=/var/empty ${q-cal} ${q-utcdate} - ${q-isodate} + ${q-deudate} ${q-sgtdate} (${q-gitdir}) & (${q-intel_backlight}) & -- cgit v1.2.3 From f5acf82913c470a73f0dd37fa826289d58663c37 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Jan 2023 13:14:04 +0100 Subject: tv q: replace wireless/online by net --- tv/5pkgs/simple/q/default.nix | 50 ++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 24 deletions(-) (limited to 'tv/5pkgs/simple') diff --git a/tv/5pkgs/simple/q/default.nix b/tv/5pkgs/simple/q/default.nix index a7a149ddc..809e37e59 100644 --- a/tv/5pkgs/simple/q/default.nix +++ b/tv/5pkgs/simple/q/default.nix @@ -79,31 +79,34 @@ let echo "VT: $(${pkgs.systemd}/bin/systemd-detect-virt)" ''; - q-wireless = /* sh */ '' + q-net = /* sh */ '' for dev in $( - ${pkgs.iw}/bin/iw dev \ - | ${pkgs.gnused}/bin/sed -n 's/^\s*Interface\s\+\([0-9a-z]\+\)$/\1/p' + ${pkgs.iproute}/bin/ip a | + ${pkgs.gnused}/bin/sed -rn 's/^[0-9]+: ([^:]+):.*/\1/p' | + ${pkgs.gnugrep}/bin/grep -Ev '^(lo|retiolum|wiregrill)$' + # TODO wiregrill ping ni.w, retiolum ping ni.r ); do - inet=$(${pkgs.iproute}/bin/ip addr show $dev \ - | ${pkgs.gnused}/bin/sed -n ' - s/.*inet \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/p - ') \ - || unset inet - ssid=$(${pkgs.iw}/bin/iw dev $dev link \ - | ${pkgs.gnused}/bin/sed -n ' - s/.*\tSSID: \(.*\)/\1/p - ') \ - || unset ssid - echo "$dev''${inet+ $inet}''${ssid+ $ssid}" + { + inet=$(${pkgs.iproute}/bin/ip addr show $dev \ + | ${pkgs.gnused}/bin/sed -n ' + s/.*inet \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/p + ') + ssid=$(${pkgs.iw}/bin/iw dev $dev link \ + | ${pkgs.gnused}/bin/sed -n ' + s/.*\tSSID: \(.*\)/\1/p + ') + latency=$( + /run/wrappers/bin/ping -W .25 -c 1 -I "$dev" ni.i 2>&1 | + ${pkgs.gnused}/bin/sed -rn ' + s/.*time=([0-9.]+).*/online ni=\1/p + s/.*Network is unreachable.*/offline/p + s/.*100% packet loss.*/offline/p + ' + ) + echo "$dev''${inet:+ $inet}''${ssid:+ $ssid} $latency" + } & done - ''; - - q-online = /* sh */ '' - if ${pkgs.curl}/bin/curl -s google.com >/dev/null; then - echo 'online' - else - echo offline - fi + wait ''; q-thermal_zone = /* sh */ '' @@ -152,8 +155,7 @@ pkgs.writeBashBin "q" '' (${q-intel_backlight}) & ${pkgs.q-power_supply}/bin/q-power_supply & (${q-virtualization}) & - (${q-wireless}) & - (${q-online}) & + (${q-net}) & (${q-thermal_zone}) & wait if test "$PWD" != "$HOME" && test -e "$HOME/TODO"; then -- cgit v1.2.3 From fe34f42c999eb1192b8161e9e6a9f637eaf30361 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Jan 2023 13:30:40 +0100 Subject: tv alacritty: use iosevka tv 2 --- tv/5pkgs/simple/alacritty-tv.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tv/5pkgs/simple') diff --git a/tv/5pkgs/simple/alacritty-tv.nix b/tv/5pkgs/simple/alacritty-tv.nix index 6c2f49db0..d9bfb8b02 100644 --- a/tv/5pkgs/simple/alacritty-tv.nix +++ b/tv/5pkgs/simple/alacritty-tv.nix @@ -53,10 +53,10 @@ let window.dimensions.lines = 9; }; variants.hidpi = { - font.normal.family = "iosevka tv 1"; - font.bold.family = "iosevka tv 1"; - font.italic.family = "iosevka tv 1"; - font.bold_italic.family = "iosevka tv 1"; + font.normal.family = "iosevka tv 2 Light"; + font.italic.family = "iosevka tv 2 Light"; + font.bold.family = "iosevka tv 2 Medium"; + font.bold_italic.family = "iosevka tv 2 Medium"; font.size = 5; key_bindings = [ { key = "Up"; mods = "Control"; action = "IncreaseFontSize"; } -- cgit v1.2.3 From c0ec617d22a2f03a110ecb5a4ab4d736c582b89e Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Jan 2023 13:31:04 +0100 Subject: tv alacritty: install config read-writable --- tv/5pkgs/simple/alacritty-tv.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tv/5pkgs/simple') diff --git a/tv/5pkgs/simple/alacritty-tv.nix b/tv/5pkgs/simple/alacritty-tv.nix index d9bfb8b02..ddf2ca8df 100644 --- a/tv/5pkgs/simple/alacritty-tv.nix +++ b/tv/5pkgs/simple/alacritty-tv.nix @@ -104,7 +104,7 @@ let ref=$(! test -e "$HOME"/ref || ${pkgs.coreutils}/bin/cat "$HOME"/ref) if test "$ref" != ${config-file}; then echo ${config-file} > "$HOME"/ref - ${pkgs.coreutils}/bin/cp ${config-file} "$HOME"/.alacritty.yml + ${pkgs.coreutils}/bin/install -m 644 ${config-file} "$HOME"/.alacritty.yml fi ''; in -- cgit v1.2.3 From 30c7470664da9dc15bdc280487c9e03105708164 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Jan 2023 13:36:10 +0100 Subject: tv: alacritty-font-size -> font-size-alacritty --- tv/5pkgs/simple/alacritty-font-size.nix | 67 --------------------------------- tv/5pkgs/simple/font-size-alacritty.nix | 67 +++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 67 deletions(-) delete mode 100644 tv/5pkgs/simple/alacritty-font-size.nix create mode 100644 tv/5pkgs/simple/font-size-alacritty.nix (limited to 'tv/5pkgs/simple') diff --git a/tv/5pkgs/simple/alacritty-font-size.nix b/tv/5pkgs/simple/alacritty-font-size.nix deleted file mode 100644 index 84bc3f616..000000000 --- a/tv/5pkgs/simple/alacritty-font-size.nix +++ /dev/null @@ -1,67 +0,0 @@ -{ pkgs }: - -pkgs.writeDashBin "font-size-alacritty" '' - # usage: font-size-alacritty (+N|-N|=N) - # Increase by, decrease by, or set font size to the value N. - - set -efu - - min_size=8 - - op=''${1%%[0-9]*} - op=''${op:-=} - - value=''${1#[=+-]} - - window_id=$(${pkgs.xdotool}/bin/xdotool getactivewindow) - - current_size=$( - ${pkgs.xorg.xprop}/bin/xprop -notype -id $window_id FONT_SIZE | - ${pkgs.gnused}/bin/sed -rn 's/.* = ([0-9]+)$/\1/p' - ) - - # usage: set_font_size WINDOW_ID FONT_SIZE - set_font_size() { - ${pkgs.alacritty}/bin/alacritty msg config -w $1 font.size=$2 - ${pkgs.xorg.xprop}/bin/xprop -id $1 -f FONT_SIZE 32c -set FONT_SIZE $2 - } - - # usage: reset_font_size WINDOW_ID - reset_font_size() { - ${pkgs.alacritty}/bin/alacritty msg config -w $1 font.size=$min_size - ${pkgs.xorg.xprop}/bin/xprop -id $1 -remove FONT_SIZE - } - - # usage: make_next_size - make_next_size() { - case $op in - -) next_size=$(expr $current_size - $value) ;; - =) next_size=$value ;; - +) - next_size=$(expr $current_size + $value) - test $next_size -ge $min_size || next_size=$min_size - ;; - esac - } - - if test -z "$current_size"; then - current_size=0 - make_next_size - if test $next_size -ge $min_size; then - ${pkgs.alacritty}/bin/alacritty msg config -w $window_id \ - font.normal.family='Input Mono' \ - font.normal.style=Condensed \ - font.bold.family='Input Mono' \ - font.bold.style=Bold - set_font_size $window_id $next_size - fi - else - make_next_size - if test $next_size -ge $min_size; then - set_font_size $window_id $next_size - else - ${pkgs.alacritty}/bin/alacritty msg config -w $window_id -r - reset_font_size $window_id - fi - fi -'' diff --git a/tv/5pkgs/simple/font-size-alacritty.nix b/tv/5pkgs/simple/font-size-alacritty.nix new file mode 100644 index 000000000..84bc3f616 --- /dev/null +++ b/tv/5pkgs/simple/font-size-alacritty.nix @@ -0,0 +1,67 @@ +{ pkgs }: + +pkgs.writeDashBin "font-size-alacritty" '' + # usage: font-size-alacritty (+N|-N|=N) + # Increase by, decrease by, or set font size to the value N. + + set -efu + + min_size=8 + + op=''${1%%[0-9]*} + op=''${op:-=} + + value=''${1#[=+-]} + + window_id=$(${pkgs.xdotool}/bin/xdotool getactivewindow) + + current_size=$( + ${pkgs.xorg.xprop}/bin/xprop -notype -id $window_id FONT_SIZE | + ${pkgs.gnused}/bin/sed -rn 's/.* = ([0-9]+)$/\1/p' + ) + + # usage: set_font_size WINDOW_ID FONT_SIZE + set_font_size() { + ${pkgs.alacritty}/bin/alacritty msg config -w $1 font.size=$2 + ${pkgs.xorg.xprop}/bin/xprop -id $1 -f FONT_SIZE 32c -set FONT_SIZE $2 + } + + # usage: reset_font_size WINDOW_ID + reset_font_size() { + ${pkgs.alacritty}/bin/alacritty msg config -w $1 font.size=$min_size + ${pkgs.xorg.xprop}/bin/xprop -id $1 -remove FONT_SIZE + } + + # usage: make_next_size + make_next_size() { + case $op in + -) next_size=$(expr $current_size - $value) ;; + =) next_size=$value ;; + +) + next_size=$(expr $current_size + $value) + test $next_size -ge $min_size || next_size=$min_size + ;; + esac + } + + if test -z "$current_size"; then + current_size=0 + make_next_size + if test $next_size -ge $min_size; then + ${pkgs.alacritty}/bin/alacritty msg config -w $window_id \ + font.normal.family='Input Mono' \ + font.normal.style=Condensed \ + font.bold.family='Input Mono' \ + font.bold.style=Bold + set_font_size $window_id $next_size + fi + else + make_next_size + if test $next_size -ge $min_size; then + set_font_size $window_id $next_size + else + ${pkgs.alacritty}/bin/alacritty msg config -w $window_id -r + reset_font_size $window_id + fi + fi +'' -- cgit v1.2.3 From 8e019e0111ed73c4f49007fa00c5ecc8c5c46f28 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Jan 2023 13:36:27 +0100 Subject: tv font-size-alacritty: min_size=5 --- tv/5pkgs/simple/font-size-alacritty.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tv/5pkgs/simple') diff --git a/tv/5pkgs/simple/font-size-alacritty.nix b/tv/5pkgs/simple/font-size-alacritty.nix index 84bc3f616..d37f0f055 100644 --- a/tv/5pkgs/simple/font-size-alacritty.nix +++ b/tv/5pkgs/simple/font-size-alacritty.nix @@ -6,7 +6,7 @@ pkgs.writeDashBin "font-size-alacritty" '' set -efu - min_size=8 + min_size=5 op=''${1%%[0-9]*} op=''${op:-=} -- cgit v1.2.3 From e726cb1f59ed675d8efee3d30cca3922c91f1e8a Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Jan 2023 13:48:00 +0100 Subject: tv libinput-tv: init with winmax2 patch --- tv/5pkgs/simple/libinput-tv.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tv/5pkgs/simple/libinput-tv.nix (limited to 'tv/5pkgs/simple') diff --git a/tv/5pkgs/simple/libinput-tv.nix b/tv/5pkgs/simple/libinput-tv.nix new file mode 100644 index 000000000..6f08689bb --- /dev/null +++ b/tv/5pkgs/simple/libinput-tv.nix @@ -0,0 +1,11 @@ +{ pkgs }: + +pkgs.libinput.overrideAttrs (old: { + patches = old.patches or [] ++ [ + (pkgs.fetchurl { + name = "libinput-winmax2.patch"; + url = "https://github.com/4z3/libinput/commit/2d0ff41.patch"; + sha256 = "0ipsxzjf98g9w2m163gp49zl14wbxs84s0psdnvk7wfiivgcnm1f"; + }) + ]; +}) -- cgit v1.2.3