config: adjustments

This commit is contained in:
xeruf 2021-09-29 18:38:57 +02:00
parent 8b62dbb677
commit 997597f242
9 changed files with 79 additions and 22 deletions

View File

@ -5,7 +5,15 @@ pid_file "~/.local/state/mpd/mpd.pid"
db_file "~/.local/state/mpd/mpd.db" db_file "~/.local/state/mpd/mpd.db"
music_directory "~/data/music" music_directory "~/data/music"
playlist_directory "~/data/music/Playlists" playlist_directory "~/.config/mpd/playlists"
playlist_plugin {
name "m3u"
enabled "true"
}
playlist_plugin {
name "extm3u"
enabled "true"
}
replaygain "track" replaygain "track"
auto_update "yes" auto_update "yes"

View File

@ -34,9 +34,11 @@ let g:firenvim_config = {
\ div[role="textbox"]:not([aria-label="Search"])', \ div[role="textbox"]:not([aria-label="Search"])',
\ 'takeover': 'always', \ 'takeover': 'always',
\ }, \ },
\ '.*mail\.protonmail\.com.*': { 'priority': 9, 'takeover': 'never', }, \ '.*mail\.protonmail\.com.*': { 'priority': 9, 'takeover': 'once', },
\ '.*twitter\.com.*': { 'priority': 9, 'takeover': 'never', }, \ '.*twitter\.com.*': { 'priority': 9, 'takeover': 'once', },
\ '.*openstreetmap\.org.*': { 'priority': 9, 'takeover': 'never', }, \ '.*openstreetmap\.org.*': { 'priority': 9, 'takeover': 'once', },
\ '.*discord\.com.*': { 'priority': 9, 'takeover': 'once', },
\
\ '.*wikipedia\.org.*': { 'priority': 9, 'takeover': 'never', }, \ '.*wikipedia\.org.*': { 'priority': 9, 'takeover': 'never', },
\ '.*wikidata\.org.*': { 'priority': 9, 'takeover': 'never', }, \ '.*wikidata\.org.*': { 'priority': 9, 'takeover': 'never', },
\ \

View File

@ -1,15 +1,14 @@
which pacman >/dev/null || return 0 which pacman >/dev/null || return 0
alias dragon='dragon-drag-and-drop'
# Arch aliases # Arch aliases
alias pac='noglob sudo pacman' alias pac='noglob sudo pacman'
alias pacs='pac -Syu --needed' alias pacs='pac -Syu --needed'
alias pacr='pac -R --recursive' alias pacr='pac -R --recursive'
alias yays='noglob yay -Sy --needed' alias yays='noglob yay -Sy --needed'
alias yayr='noglob yay -R --cascade --recursive' alias yayr='noglob yay -R --cascade --recursive'
alias yau='yay -Syu --sudoloop --nobatchinstall' alias yau='yay -Syu --nobatchinstall'
# Helper function to integrate yay and fzf
yzf() { yzf() {
pos=$1 pos=$1
shift shift
@ -20,23 +19,28 @@ yzf() {
"$@" | cut -f$pos | xargs "$@" | cut -f$pos | xargs
} }
# print -s adds a shell history entry # Dev note: print -s adds a shell history entry
# List installable packages into fzf and install selection
yas() { yas() {
cache_dir="/tmp/yas-$USER" cache_dir="/tmp/yas-$USER"
test "$1" = "-y" && rm -rf "$cache_dir" && shift test "$1" = "-y" && rm -rf "$cache_dir" && shift
mkdir -p "$cache_dir" mkdir -p "$cache_dir"
preview_cache="$cache_dir/preview_{2}" preview_cache="$cache_dir/preview_{2}"
list_cache="$cache_dir/list" list_cache="$cache_dir/list"
{ test "$(cat "$list_cache$@" | wc -l)" -lt 50000 && rm "$list_cache$@"; } 2>/dev/null
pkg=$( (cat "$list_cache$@" 2>/dev/null || { pacman --color=always -Sl "$@"; yay --color=always -Sl aur "$@" } | sed 's/ [^ ]*unknown-version[^ ]*//' | tee "$list_cache$@") | pkg=$( (cat "$list_cache$@" 2>/dev/null || { pacman --color=always -Sl "$@"; yay --color=always -Sl aur "$@" } | sed 's/ [^ ]*unknown-version[^ ]*//' | tee "$list_cache$@") |
yzf 2 --tiebreak=index --preview="cat $preview_cache 2>/dev/null | grep -v 'Querying' | grep . || yay --color always -Si {2} | tee $preview_cache") yzf 2 --tiebreak=index --preview="cat $preview_cache 2>/dev/null | grep -v 'Querying' | grep . || yay --color always -Si {2} | tee $preview_cache")
if test -n "$pkg" if test -n "$pkg"
then echo "Installing $pkg..." then echo "Installing $pkg..."
cmd="yay -S --sudoloop --nobatchinstall $pkg" cmd="yay -S $pkg"
print -s "$cmd" print -s "$cmd"
eval "$cmd" eval "$cmd"
rehash rehash
fi fi
} }
# List installed packages into fzf and remove selection
# Tip: use -e to list only explicitly installed packages
yar() { yar() {
pkg=$(yay --color=always -Q "$@" | yzf 1 --tiebreak=length --preview="yay --color always -Qli {1}") pkg=$(yay --color=always -Q "$@" | yzf 1 --tiebreak=length --preview="yay --color always -Qli {1}")
if test -n "$pkg" if test -n "$pkg"

View File

@ -2,11 +2,13 @@
suffix="${2:-bak}" suffix="${2:-bak}"
orig="${1%%.$suffix}" orig="${1%%.$suffix}"
smv () { smv () {
test -w "$1" && mv -v "$@" || sudo mv -v "$@" eval source=\$$(($#-1))
test -w "$source" && mv -v "$@" || sudo mv -v "$@"
} }
if test -e "$orig.$suffix" if test -e "$orig.$suffix"
then then
test -e "$orig" && smv "$orig" /tmp test -e "$orig" && smv "$orig" /tmp
smv -n "$orig.$suffix" "$orig" smv -n "$orig.$suffix" "$orig"
else smv -n "$1" "$1.$suffix" else
smv -n "$1" "$1.$suffix"
fi fi

View File

@ -31,10 +31,15 @@ if test -f "/var/log/apt/history.log"; then
export aptclean_last=$aptclean_cur export aptclean_last=$aptclean_cur
fi fi
highlight "c to recursively remove development caches" highlight "d to recursively remove development caches"
if [[ $1 =~ "c" ]]; then if [[ $1 =~ "d" ]]; then
find -name ".gradle" -o -name "generated" -o -name "dist_newstyle" -o -name "cache" -o -name "node_modules" -print -exec rm -r {} + -prune find -name "src" -prune -o \
find -name "*build" -print -exec rm -rI {} + -prune -type d \( -name ".gradle" -o -name "generated" -o -name "dist-newstyle" -o -name "cache" -o -name "node_modules" -name "cmake_build" \) \
-print -exec rm -r {} + -prune
echo -n " " && highlight "build directories"
find \( -name ".git" -o -path "*/mixxx/build" -o -name "Leaflet" \) -prune \
-o -name "build" -type d \
-print -exec rm -rI {} + -prune
fi fi
highlight "m to recursively remove mac-files" highlight "m to recursively remove mac-files"

View File

@ -6,7 +6,8 @@ shift
url="ssh://aur@aur.archlinux.org/${1:-$(basename $PWD)}.git" url="ssh://aur@aur.archlinux.org/${1:-$(basename $PWD)}.git"
case $command in case $command in
(origin) (origin)
test "$(git rev-parse --git-dir)" = ".git" && git remote set-url origin "$url";; test "$(git rev-parse --git-dir)" = ".git" && git remote set-url origin "$url"
git remote -v;;
(clone) (clone)
cd "$aurdir" cd "$aurdir"
git -c init.defaultBranch=master clone "$url" git -c init.defaultBranch=master clone "$url"

View File

@ -1,7 +1,8 @@
#!/bin/sh #!/bin/sh
# open info-page, man-page or buffered help flag # open info-page, man-page or command help
set -o pipefail set -o pipefail
paginate="${PAGER:-less} +Gg" paginate="${PAGER:-less} +Gg"
test "$1" = "-d" && browse=1 && shift
case $1 in case $1 in
(zsh|zmv) # https://unix.stackexchange.com/questions/19290/zmv-for-zsh-dry-runs-and-man-pages (zsh|zmv) # https://unix.stackexchange.com/questions/19290/zmv-for-zsh-dry-runs-and-man-pages
search="${@:$#}" search="${@:$#}"
@ -12,3 +13,19 @@ case $1 in
(caddy) $1 help ${@:2} | $paginate;; (caddy) $1 help ${@:2} | $paginate;;
(*) man "$@" || { info "$1" -w | grep -v "manpages" && pinfo "$@"; } || ( "$@" --help || "$@" -help ) 2>&1 | $paginate;; (*) man "$@" || { info "$1" -w | grep -v "manpages" && pinfo "$@"; } || ( "$@" --help || "$@" -help ) 2>&1 | $paginate;;
esac esac
docs="/usr/share/doc/$1"
if test -d "$docs"; then
if test -z "$browse"
then echo "Find more in $docs"
else
len() { echo $1 | wc -c; }
shortest() {
read shortest
while read in
do test $(len $shortest) -gt $(len $in) && shortest=$in
done
echo $shortest
}
firefox "file://$(find $docs -name index.html | shortest | grep . || find $docs -name $1*.html | shortest)"
fi
fi

View File

@ -32,7 +32,7 @@ export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME/java"
export GRADLE_USER_HOME="$XDG_STATE_HOME"/gradle export GRADLE_USER_HOME="$XDG_STATE_HOME"/gradle
export ANDROID_PREFS_ROOT="$XDG_CONFIG_HOME"/android export ANDROID_PREFS_ROOT="$XDG_CONFIG_HOME"/android
export ANDROID_EMULATOR_HOME="$XDG_STATE_HOME"/android/emulator export ANDROID_EMULATOR_HOME="$XDG_STATE_HOME"/android/emulator
export ANDROID_SDK_ROOT="/opt/android-sdk" export ANDROID_SDK_ROOT="/opt/android/sdk"
export PATH="$PATH:$ANDROID_SDK_ROOT/platform-tools" export PATH="$PATH:$ANDROID_SDK_ROOT/platform-tools"
# taskwarrior & timewarrior # taskwarrior & timewarrior
export TIMEWARRIORDB="$XDG_DATA_HOME/timewarrior" export TIMEWARRIORDB="$XDG_DATA_HOME/timewarrior"

View File

@ -30,8 +30,26 @@ and configuration for ~less~ and ~fzf~.
# Use org-yank-visible # Use org-yank-visible
- essentials :: git zsh bat neovim man-db texinfo - essentials :: git zsh bat neovim man-db texinfo
- basic tools :: fd ripgrep tree jrnl python-pynvim wget zsh-completions mlocate - basic tools :: fd ripgrep tree jrnl python-pynvim wget zsh-completions mlocate
- common tools :: ffmpeg imagemagick pandoc [[https://lftp.yar.ru/][lftp]] zsh-doc glances - common tools :: ffmpeg imagemagick pandoc [[https://lftp.yar.ru/][lftp]] zsh-doc glances pacman-contrib
- aur :: diffr bat-extras-git tldr++ - aur :: diffr bat-extras-git tldr++ rdictcc-git stretchly-xeruf-git
- x :: xorg-xserver xorg-xkill xorg-setxkbmap xorg-xinit xterm xclip ** Graphical
- x :: xorg-xserver xorg-xkill xorg-setxkbmap xorg-xinit xterm xclip xprintidle
- music :: mpd mpc ncmpc vlc phonon-qt5-vlc
: mkdir -p ~/.local/state/mpd && systemctl --user enable --now mpd
- music production :: lilypond lilypond-docs timidity++ chordpro-git
- kde :: plasma-desktop plasma-nm spectacle breeze systemsettings konsole ktorrent dolphin kdeplasma-addons kinfocenter partitionmanager kdeconnect kwallet-pam kwalletmanager ksshaskpass okular
- office :: emacs texlive-core texlive-latexextra libreoffice-fresh - office :: emacs texlive-core texlive-latexextra libreoffice-fresh
- server :: pleroma-bin postgresql caddy ** Dev
#+begin_source sh
yays intellij-idea-ultimate-edition intellij-idea-ultimate-edition-jre \
clion clion-jre cmake gdb \
jdk-openjdk java-openjfx jdk8-openjdk java8-openjfx
archlinux-java set jdk8-openjdk
#+end_source
*** Android
: yays android-udev android-tools adbfs-rootless-git android-studio
After running android-studio setup, accept licenses:
: $ANDROID_SDK_ROOT/tools/bin/sdkmanager --licenses
** Server
Setup systemd-resolved and systemd-networkd
- social :: pleroma-bin postgresql caddy