Update up script to be pure bash
Anirudh Oppiliappan x@icyphox.sh
Fri, 26 Mar 2021 11:04:24 +0530
2 files changed,
17 insertions(+),
18 deletions(-)
M
home/bin/up
→
home/bin/up
@@ -1,16 +1,27 @@
#!/usr/bin/env bash -random_name="$(tr -dc 'a-zA-Z0-9' < /dev/random | fold -w 5 | head -n 1)" +gen_random() { + chars="abcdefghijklmnopqrstuvwxyz0123456789-~" + for i in { 1 .. 6 }; do + printf '%s' "${chars:RANDOM%${#chars}:1}" + done +} + +random_name="$(gen_random)" export LATEST_SCROT="$HOME/pics/scrots/latest.png" upload() { file="$(basename "$1")" - ext="${file##*.}" - fullname="$random_name.$ext" - scp -P 22222 "$1" fern:~/www/icy/uploads/"$fullname" - printf '%s\n' "https://x.icyphox.sh/$fullname" - printf '%s' "https://x.icyphox.sh/$fullname" | xclip -selection clipboard + ext="${file##*.}" + fullname="$random_name.$ext" + rsync --archive --partial --progress --rsh=ssh "$1" fern:~/www/icy/uploads/"$fullname" + printf '%s\n' "https://x.icyphox.sh/$fullname" + if [ "$(uname)" != "Darwin" ]; then + printf '%s' "https://x.icyphox.sh/$fullname" | xclip -selection clipboard + else + printf '%s' "https://x.icyphox.sh/$fullname" | pbcopy + fi } if [ "$1" == "l" ]; then
M
weechat/weechat.conf
→
weechat/weechat.conf
@@ -390,18 +390,6 @@ title.type = window
[layout] default.buffer = "core;weechat;1" -default.buffer = "irc;server.freenode;2" -default.buffer = "irc;freenode.##crustaceans;3" -default.buffer = "irc;freenode.#kisslinux;4" -default.buffer = "irc;freenode.#kubernetes;5" -default.buffer = "irc;freenode.#lobsters;6" -default.buffer = "irc;freenode.#neovim;7" -default.buffer = "irc;freenode.#openbsd;8" -default.buffer = "irc;freenode.*status;9" -default.buffer = "irc;server.rizon;10" -default.buffer = "irc;rizon.#buddy;11" -default.buffer = "irc;rizon.#homescreen;12" -default.buffer = "irc;rizon.#rice;13" default.window = "1;0;0;0;irc;rizon.Carp" default.current = on