tv q: add sigils
This commit is contained in:
parent
6cef97deb3
commit
6c734674da
@ -14,7 +14,7 @@ let
|
|||||||
assert n >= 1;
|
assert n >= 1;
|
||||||
n * calwidth + (n - 1) * hspace;
|
n * calwidth + (n - 1) * hspace;
|
||||||
|
|
||||||
pad = ''{
|
pad = /* sh */ ''{
|
||||||
${pkgs.gnused}/bin/sed '
|
${pkgs.gnused}/bin/sed '
|
||||||
# rtrim
|
# rtrim
|
||||||
s/ *$//
|
s/ *$//
|
||||||
@ -31,7 +31,7 @@ let
|
|||||||
s/^[ 1-9][0-9]/[38;5;238;1m&[39;22m/
|
s/^[ 1-9][0-9]/[38;5;238;1m&[39;22m/
|
||||||
'
|
'
|
||||||
}'';
|
}'';
|
||||||
in ''
|
in /* sh */ ''
|
||||||
cols=$(${pkgs.ncurses}/bin/tput cols)
|
cols=$(${pkgs.ncurses}/bin/tput cols)
|
||||||
${pkgs.coreutils}/bin/paste \
|
${pkgs.coreutils}/bin/paste \
|
||||||
<(if test $cols -ge ${toString (need_width 3)}; then
|
<(if test $cols -ge ${toString (need_width 3)}; then
|
||||||
@ -59,24 +59,24 @@ let
|
|||||||
'
|
'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
q-isodate = ''
|
q-isodate = /* sh */ ''
|
||||||
${pkgs.coreutils}/bin/date \
|
${pkgs.coreutils}/bin/date \
|
||||||
'+[1m%Y-%m-%d[;30mT[;38;5;085m%H:%M[m:%S%:z'
|
'+[1m%Y-%m-%d[;30mT[;38;5;085m%H:%M[m:%S%:z'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Singapore's red is #ED2E38
|
# Singapore's red is #ED2E38
|
||||||
q-sgtdate = ''
|
q-sgtdate = /* sh */ ''
|
||||||
TZ=Asia/Singapore \
|
TZ=Asia/Singapore \
|
||||||
${pkgs.coreutils}/bin/date \
|
${pkgs.coreutils}/bin/date \
|
||||||
'+[1m%Y-%m-%d[;30mT[;38;5;088m%H:%M[m:%S%:z'
|
'+[1m%Y-%m-%d[;30mT[;38;5;088m%H:%M[m:%S%:z'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
q-utcdate = ''
|
q-utcdate = /* sh */ ''
|
||||||
${pkgs.coreutils}/bin/date -u \
|
${pkgs.coreutils}/bin/date -u \
|
||||||
'+[1m%Y-%m-%d[;30mT[;38;5;065m%H:%M[m:%S%:z'
|
'+[1m%Y-%m-%d[;30mT[;38;5;065m%H:%M[m:%S%:z'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
q-gitdir = ''
|
q-gitdir = /* sh */ ''
|
||||||
if test -d .git; then
|
if test -d .git; then
|
||||||
#git status --porcelain
|
#git status --porcelain
|
||||||
branch=$(
|
branch=$(
|
||||||
@ -87,7 +87,7 @@ let
|
|||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
q-intel_backlight = ''
|
q-intel_backlight = /* sh */ ''
|
||||||
cd /sys/class/backlight/intel_backlight
|
cd /sys/class/backlight/intel_backlight
|
||||||
</dev/null exec ${pkgs.gawk}/bin/awk '
|
</dev/null exec ${pkgs.gawk}/bin/awk '
|
||||||
END {
|
END {
|
||||||
@ -227,11 +227,11 @@ let
|
|||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
|
|
||||||
q-virtualization = ''
|
q-virtualization = /* sh */ ''
|
||||||
echo "VT: $(${pkgs.systemd}/bin/systemd-detect-virt)"
|
echo "VT: $(${pkgs.systemd}/bin/systemd-detect-virt)"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
q-wireless = ''
|
q-wireless = /* sh */ ''
|
||||||
for dev in $(
|
for dev in $(
|
||||||
${pkgs.iw}/bin/iw dev \
|
${pkgs.iw}/bin/iw dev \
|
||||||
| ${pkgs.gnused}/bin/sed -n 's/^\s*Interface\s\+\([0-9a-z]\+\)$/\1/p'
|
| ${pkgs.gnused}/bin/sed -n 's/^\s*Interface\s\+\([0-9a-z]\+\)$/\1/p'
|
||||||
@ -250,7 +250,7 @@ let
|
|||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
|
|
||||||
q-online = ''
|
q-online = /* sh */ ''
|
||||||
if ${pkgs.curl}/bin/curl -s google.com >/dev/null; then
|
if ${pkgs.curl}/bin/curl -s google.com >/dev/null; then
|
||||||
echo '[32;1monline[m'
|
echo '[32;1monline[m'
|
||||||
else
|
else
|
||||||
@ -258,7 +258,7 @@ let
|
|||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
q-thermal_zone = ''
|
q-thermal_zone = /* sh */ ''
|
||||||
for i in /sys/class/thermal/thermal_zone*; do
|
for i in /sys/class/thermal/thermal_zone*; do
|
||||||
type=$(${pkgs.coreutils}/bin/cat $i/type)
|
type=$(${pkgs.coreutils}/bin/cat $i/type)
|
||||||
temp=$(${pkgs.coreutils}/bin/cat $i/temp)
|
temp=$(${pkgs.coreutils}/bin/cat $i/temp)
|
||||||
@ -266,7 +266,7 @@ let
|
|||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
|
|
||||||
q-todo = ''
|
q-todo = /* sh */ ''
|
||||||
TODO_file=$PWD/TODO
|
TODO_file=$PWD/TODO
|
||||||
if test -e "$TODO_file"; then
|
if test -e "$TODO_file"; then
|
||||||
${pkgs.coreutils}/bin/cat "$TODO_file" \
|
${pkgs.coreutils}/bin/cat "$TODO_file" \
|
||||||
|
Loading…
Reference in New Issue
Block a user