diff --git a/.bashrc b/.bashrc index 4a9dac6652c540041b13ee3300853065ff06692f..3bfc0eac04b856f67df93509a59be27500482651 100644 --- a/.bashrc +++ b/.bashrc @@ -100,36 +100,6 @@ alias screenshot-cleanup='find "$HOME/Pictures" -name "Screenshot from *.png" -d alias bell="printf '\a'" command -v notify-send > /dev/null || alias notify-send='bell' -urlencode () { - if [ -t 0 ] - then - echo "$@" | urlencode - else - python3 -c ' -from sys import stdin -from urllib.parse import quote_plus -for line in stdin.readlines(): - print(quote_plus(line.strip())) -' - fi -} - -# shellcheck disable=SC2120 -urldecode () { - if [ -t 0 ] - then - # shellcheck disable=SC2119 - echo "$@" | urldecode - else - python3 -c ' -from sys import stdin -from urllib.parse import unquote_plus -for line in stdin.readlines(): - print(unquote_plus(line.strip())) -' - fi -} - monitor () { if eval "$@" then diff --git a/Documents/bin/urldecode b/Documents/bin/urldecode new file mode 100755 index 0000000000000000000000000000000000000000..87954fe6f3592a37136320b1b48d0b0a7e2bdb38 --- /dev/null +++ b/Documents/bin/urldecode @@ -0,0 +1,8 @@ +#!/usr/bin/env python3 +from fileinput import input +from urllib.parse import unquote_plus as unquote + + +if __name__ == '__main__': + for line in input(): + print(unquote(line.strip())) diff --git a/Documents/bin/urlencode b/Documents/bin/urlencode new file mode 100755 index 0000000000000000000000000000000000000000..3f93145c3b495a339ac534aa32b27b66e54c7e1a --- /dev/null +++ b/Documents/bin/urlencode @@ -0,0 +1,8 @@ +#!/usr/bin/env python3 +from fileinput import input +from urllib.parse import quote_plus as quote + + +if __name__ == '__main__': + for line in input(): + print(quote(line.strip()))