This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# assuming you use NetworkManager | |
if [ "$(nmcli networking connectivity check)" != "none" -a ! -z "${KITTY_PID+x}" ]; then | |
XKCD_JSON="$(curl -s https://xkcd.com/info.0.json)" | |
NUM="$(echo $XKCD_JSON | jq -r '.num')" | |
# suppresses error when file does not exist | |
if [ "$(cat ~/.last_xkcd 2>/dev/null)" != "$NUM" ]; then | |
echo $NUM > ~/.last_xkcd | |
echo $XKCD_JSON | jq -r '.safe_title' | |
kitten icat --align left "$(echo $XKCD_JSON | jq -r '.img')" | |
echo $XKCD_JSON | jq -r '.alt' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias j2p="xclip -o | sed -r 's@//@#@g; s/var\s//g; s/\;//g; s/===/==/g; s/}\s//g; s/}//g; s/else\sif\s\(/elif /g; s/else\sif\(/elif /g; s/if\s\(/if /g; s/if\(/if /g; s/else\s\{/else:/g; s/else\{/else:/g; s/&&/and/g; s/&/and/g; s/\|\|/or/g; /\s=\sfunction/s/^/def /; s/\s=\sfunction//g; /^def/! s/\)\s\{/:/g; /^def/! s/\)\{/:/g; s/\s\{/:/g; s/\{/:/g; s/mouseClicked\(\)/mouseClicked\(e\)/g; s/true/True/g; s/false/False/g; s/this./self./g; s/new\s//g; s/.push\(/ += [/g; s/\+\+/ += 1/g; s/\-\-/ -= 1/g; s/sin\(/sin\(degrees\(/g; s/cos\(/cos\(degrees\(/g; s/tan\(/tan\(degrees\(/g; s/getImage\(/loadImage\(/g; s/keyPressed\(\)/keyPressed\(e\)/g; s/keyReleased\(\)/keyReleased\(e\)/g; s/pushMatrix\(\)/push\(\)/g; s/popMatrix\(\)/pop\(\)/g; s/\!==/\!=/g; s/null/None/g; s/background\(\)/background\(255\)/g' | xclip -selection clipboard" |