From 750eecccdb229debde1854601daf190b51ae2536 Mon Sep 17 00:00:00 2001 From: yuzu-eva Date: Thu, 15 Dec 2022 21:29:12 +0100 Subject: cleaned up my aliases, added evil-surround to emacs --- .bash_aliases | 104 ++++++++++++++++++++---------------------- .config/sxiv/exec/key-handler | 2 +- .emacs.d/config.el | 2 + .emacs.d/packages.el | 5 ++ .xinitrc | 9 ++++ 5 files changed, 66 insertions(+), 56 deletions(-) diff --git a/.bash_aliases b/.bash_aliases index 3e8c813..d50ddf2 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -5,10 +5,9 @@ # \___\__,_|_| \___|_.__/ \__,_|_.__/ \___| # -################# -# Miscellaneous # -################# +## MISCELLANEOUS +# various shortcuts alias reboot='sudo reboot' alias poweroff='sudo poweroff' alias refresh='source ~/.bashrc' @@ -17,6 +16,22 @@ alias open='xdg-open' alias rsync='rsync -avh --progress' alias cwp='xwallpaper --maximize "$(/usr/bin/ls -1 -d /hdd/pics/wallpaper/* | shuf -n1)"' alias fd='fdfind' +alias mutt='pushd ~/.mutt/attachments; mutt; popd' +alias jpwine='LANG=ja_JP.UTF-8 WINEDEBUG=-all wine' +alias emacs='emacsclient -c -a "emacs"' +alias cn='clear;macchina' + +# cp mv and rm always verbose +alias cp='cp -v' +alias mv='mv -v' +alias rm='rm -v' + +# Colorize grep output +alias grep='grep --color=auto -i' + +# color ls, always full info and human readable; group dirs +alias ls='ls -hl --color=always --group-directories-first' +alias la='ls -a' # Control Audio alias headset="wpctl set-default $(wpctl status | grep 'Headphones' | cut -b11-12)" @@ -31,17 +46,9 @@ alias setrmon-lowres='xrandr --auto --output DisplayPort-2 --mode 640x480 --left alias setrmon-midres='xrandr --auto --output DisplayPort-2 --mode 800x600 --left-of HDMI-A-0' alias setrmon-default='xrandr --auto --output DisplayPort-2 --mode 1600x900 --left-of HDMI-A-0' -alias cn='clear;macchina' +## FUNCTIONS FOR CONVERTING DATE TO ISO 8601 -# Colorize grep output -alias grep='grep --color=auto -i' - -alias ls='ls -hl --color=always --group-directories-first' -alias la='ls -a' - -alias nnn='nnn -Hde' - -# Convert date from YYYYMMDD to YYYY-MM-DD +# convert date from YYYYMMDD to YYYY-MM-DD date-convert() { for i in *; do mv "${i}" "$(echo "${i}" | @@ -49,7 +56,7 @@ date-convert() { done; } -# Reverse date from DD-MM-YYYY to YYYY-MM-DD +# reverse date from DD-MM-YYYY to YYYY-MM-DD date-reverse() { for i in *; do mv "${i}" "$(echo "${i}" | @@ -57,10 +64,7 @@ date-reverse() { done; } -# Convert video files to webm -mkwebm() { - ffmpeg -i "${1}" -crf 1 -b:v 1M -c:a libvorbis "${1%.*}".webm -} +## RECORDING, DOWNLOADING AND CONVERTING VIDEO # record primary monitor with audio output and input record() { @@ -74,10 +78,26 @@ record() { ~/vids/"$1".mkv } -####### -# git # -####### +# shortcuts for most used yt-dlp calls +alias ytvid='yt-dlp -o "/hdd/vids/random/%(title)s.%(ext)s" --remux-video "mkv"' +alias ytreact='yt-dlp -o "/hdd/pics/reactions/gif/%(title)s.%(ext)s" --recode-video "webm"' +alias ytarchive='yt-dlp -o "/hdd/vids/archives/%(uploader)s/%(upload_date)s - %(title)s/%(title)s.%(ext)s" --remux-video "mkv"' + +# function to specify filename, so I can avoid total chaos in my library +ytmp3() { + read -p "Enter filename: " name; + yt-dlp -x --audio-format mp3 --download-archive "/hdd/music/Archive_goodMusic.txt" \ + --embed-metadata -o "/hdd/music/Youtube Downloads/$name.%(ext)s" $1 +} + +# convert video files to webm +mkwebm() { + ffmpeg -i "${1}" -crf 1 -b:v 1M -c:a libvorbis "${1%.*}".webm +} + +## GIT +# general shortcuts alias commit='git commit -m' alias fetch='git fetch' alias upstream='git push --set-upstream origin' @@ -85,45 +105,19 @@ alias remote='git remote add origin' alias pull='git pull origin' alias push='git push origin' -# Shortcut for dotfiles repo +# shortcut for dotfiles repo alias dfiles='/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME' +alias dcomm='dfiles commit -m' +alias dpush='dfiles push origin' -################### -# Package Manager # -################### +## PACKAGE MANAGER alias aptin='sudo apt install' alias aptup='sudo apt update && sudo apt upgrade' alias aptupd='sudo apt update' alias aptupg='sudo apt upgrade' alias aptrm='sudo apt remove' -alias aptsr='apt search' -alias listup='apt list --upgradeable' -alias listin='apt list --installed' - -########## -# yt-dlp # -########## - -alias ytvid='yt-dlp -o "/hdd/vids/random/%(title)s.%(ext)s" --remux-video "mkv"' -alias ytarchive='yt-dlp -o "/hdd/vids/archives/%(uploader)s/%(upload_date)s - %(title)s/%(title)s.%(ext)s" --remux-video "mkv"' - -# Function to specify filename, so I can avoid total chaos in my library -ytmp3() { - read -p "Enter filename: " name; - yt-dlp -x --audio-format mp3 --download-archive "/hdd/music/Archive_goodMusic.txt" \ - --embed-metadata -o "/hdd/music/Youtube Downloads/$name.%(ext)s" $1 -} - -########### -# Network # -########### - -alias flush-dns='sudo /etc/init.d/dns-clean start' - -############# -# Shortcuts # -############# - -alias jpwine='LANG=ja_JP.UTF-8 WINEDEBUG=-all wine' -alias emacs='emacsclient -c -a "emacs"' +alias aptsr='sudo apt search' +alias aptsh='sudo apt show' +alias listup='sudo apt list --upgradeable' +alias listin='sudo apt list --installed' diff --git a/.config/sxiv/exec/key-handler b/.config/sxiv/exec/key-handler index 5ca4443..19bcc67 100755 --- a/.config/sxiv/exec/key-handler +++ b/.config/sxiv/exec/key-handler @@ -3,7 +3,7 @@ while read file do case "$1" in - "C-d") trash-put "$file" ;; + "C-d") rm "$file" ;; "C-c") cat "$file" | xclip -sel c -t image/png ;; "C-w") xwallpaper --maximize "$file" ;; esac diff --git a/.emacs.d/config.el b/.emacs.d/config.el index 7634932..b05ee7e 100644 --- a/.emacs.d/config.el +++ b/.emacs.d/config.el @@ -2,6 +2,8 @@ (add-hook 'prog-mode-hook 'display-line-numbers-mode) (add-hook 'emacs-startup-hook 'startup/revert-file-name-handler-alist) (add-hook 'emacs-startup-hook 'startup/reset-gc) +;; Mutt support +(add-to-list 'auto-mode-alist '("/tmp/mutt.*" . mail-mode)) (show-paren-mode 1) (tool-bar-mode -1) diff --git a/.emacs.d/packages.el b/.emacs.d/packages.el index eddb559..9abae55 100644 --- a/.emacs.d/packages.el +++ b/.emacs.d/packages.el @@ -328,3 +328,8 @@ (meghanada-mode t))) (setq meghanada-java-path "java") (setq meghanada-maven-path "mvn")) + +(use-package evil-surround + :ensure t + :config + (global-evil-surround-mode 1)) diff --git a/.xinitrc b/.xinitrc index 9c5ce38..41825cb 100644 --- a/.xinitrc +++ b/.xinitrc @@ -11,6 +11,14 @@ if [ -f $HOME/.local/bin/statusbar ]; then . $HOME/.local/bin/statusbar fi +envfile="$HOME/.gnupg/gpg-agent.env" +if [[ -e "$envfile" ]] && kill -0 $(grep GPG_AGENT_INFO "$envfile" | cut -d: -f 2) 2>/dev/null; then + eval "$(cat "$envfile")" +else + eval "$(gpg-agent --daemon --allow-preset-passphrase --write-env-file "$envfile")" +fi +export GPG_AGENT_INFO + rfkill block all xset s off -dpms setxkbmap -option "ctrl:nocaps" @@ -28,6 +36,7 @@ xrandr --auto --output DisplayPort-2 --mode 1600x900 --left-of HDMI-A-0 dbus-launch --sh-syntax --exit-with-session +eval $(ssh-agent) pipewire & mpd & /usr/local/bin/emacs --daemon & -- cgit v1.2.3