You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.5 KiB

# --- enable/disable this file ---
SRC_ENABLED=false
case "$SRC_ENABLED" in
1|true|yes|on) unset SRC_ENABLED ;; # enabled — clean up and continue
*) unset SRC_ENABLED; return ;; # disabled — clean up and skip this file
esac
# ---------------------------------
if [ "$HOSTNAME" = "$HOMEHOST" ]; then
. ~/.config/termclock.rc
mman() {
kitten @ --to unix:@manualy send-key --match 'var:role=termclock' ctrl+c
local CMD
printf -v CMD 'man %q' "$1"
printf '%s' "$CMD" | kitten @ --to unix:@manualy send-text --match 'var:role=termclock' --stdin
kitten @ --to unix:@manualy send-key --match 'var:role=termclock' enter
}
cman() {
kitten @ --to unix:@manualy send-key --match 'var:role=termclock' q
kitten @ --to unix:@manualy send-key --match 'var:role=termclock' ctrl+c
kitten @ --to unix:@manualy send-key --match 'var:role=termclock' ctrl+l
local CMD
printf -v CMD "TERM_CLOCK_COLOR=%q TERM_CLOCK_SYMBOL=%q TERM_CLOCK_SELF=%q TERM_CLOCK_NO_DAY=%q %s -g3" "$TERM_CLOCK_COLOR" "$TERM_CLOCK_SYMBOL" "$TERM_CLOCK_SELF" "$TERM_CLOCK_NO_DAY" "$TERM_CLOCK_CMD"
printf '%s' "$CMD" | kitten @ --to unix:@manualy send-text --match 'var:role=termclock' --stdin
kitten @ --to unix:@manualy send-key --match 'var:role=termclock' enter
}
fi