diff --git a/deploy.sh b/deploy.sh index 9c2e9a1..af5f7a4 100755 --- a/deploy.sh +++ b/deploy.sh @@ -118,6 +118,7 @@ cp -rfv ./home/.config/nvim/ ~/.config/nvim/ cp -rfv ./home/.config/pipe-viewer/ ~/.config/pipe-viewer/ cp -rfv ./home/.config/qutebrowser/ ~/.config/qutebrowser/ cp -rfv ./home/.config/ranger/ ~/.config/ranger/ +cp -rfv ./home/.config/tg/ ~/.config/tg/ cp -rfv ./home/.config/tmux/ ~/.config/tmux/ cp -rfv ./home/.config/translate-shell/ ~/.config/translate-shell/ # cp -rfv ./home/.config/tridactyl/ ~/.config/tridactyl/ diff --git a/home/.config/tg/conf.py b/home/.config/tg/conf.py new file mode 100644 index 0000000..c7d22cb --- /dev/null +++ b/home/.config/tg/conf.py @@ -0,0 +1,33 @@ +import os + +PHONE = '' +URL_VIEW = 'urlview' +KEEP_MEDIA = 7 +FILE_PICKER_CMD = "nnn -p {file_path}" +# FILE_PICKER_CMD = "ranger --choosefile={file_path}" +DOWNLOAD_DIR = os.path.expanduser("~/Downloads/") +MAILCAP_FILE = os.path.expanduser("~/.config/tg/mailcap") +CHAT_FLAGS = { + "online": "●", + "pinned": "P", + "muted": "M", + "unread": "U", + "unseen": "?", + "secret": "🔒", + "seen": "✓", +} +MSG_FLAGS = { + "selected": "*", + "forwarded": "F", + "new": "N", + "unseen": "U", + "edited": "E", + "pending": "...", + "failed": "💩", + "seen": "✓", +} +LOG_LEVEL = "DEBUG" +LOG_PATH = os.path.expanduser("~/.local/share/tg/") +VOICE_RECORD_CMD = "ffmpeg -f avfoundation -i ':0' -c:a libopus -b:a 32k {file_path}" +NOTIFY_CMD = "notify-send '{title}-{subtitle}' '{msg}' -i {icon_path}" +USERS_COLORS = tuple(range(2,16)) diff --git a/home/.config/tg/mailcap b/home/.config/tg/mailcap new file mode 100644 index 0000000..b20038f --- /dev/null +++ b/home/.config/tg/mailcap @@ -0,0 +1,12 @@ +# media +video/*; mpv "%s" +audio/ogg; mpv --speed 1.33 "%s" +audio/mpeg; mpv --no-video "%s" +image/*; qimgv "%s" + +# text +text/html; qutebrowser "%s" +text/plain; less "%s" + +# fallback to vim +text/*; nvim "%s" diff --git a/home/.local/bin/dict b/home/.local/bin/dict index d193c83..6a92663 100755 --- a/home/.local/bin/dict +++ b/home/.local/bin/dict @@ -7,7 +7,7 @@ underline=$(tput smul) esc=$(tput sgr0) if [ -z "$1" ]; then - sort ~/.local/share/words.txt | fzf --no-multi | xargs -r dict + fzf --no-multi < ~/.local/share/words.txt | tr -d '\r' | xargs -r dict else curl -s "dict://dict.org/d:$1" | sed -n -e '/^151.*/,/^\./p' | sed -e 's/^151.*//g' -e '/^\./D' -e '/^\s*1\./i\\' -e "s/{\([^{]*\)}/${esc}${bold}${underline}\1${esc}/g" -e "s/^\($1\)\(\W\)/${esc}${bold}${red}\1${esc}\2/gI" -e "s/^\(\s*\)\([0-9]\.\)/\1${esc}${bold}${cyan}\2${esc}/g" -e 's/--/—/g' -e 's/—\(\w\)/— \1/g' fi diff --git a/setup/scripts.sh b/setup/scripts.sh index 8af414a..753148b 100755 --- a/setup/scripts.sh +++ b/setup/scripts.sh @@ -30,4 +30,4 @@ if [ "${answer}" = "y" ]; then fi # Not a script but whatever -curl -fL https://github.com/dwyl/english-words/raw/master/words.txt $HOME/.local/share/words.txt +curl -fL https://github.com/dwyl/english-words/raw/master/words_alpha.txt $HOME/.local/share/words.txt