From 08aaa33064179c45358f3bbe16636c8d34a20a90 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Sun, 20 Sep 2020 23:29:01 +0800 Subject: [PATCH] [bugfix] mpv configuration file linking --- env.sh | 4 ++-- optim/ls-vscode-cache.fish | 8 ++++++++ player/config/mpd/mpd.conf | 2 +- player/install.sh | 8 +++++--- 4 files changed, 16 insertions(+), 6 deletions(-) create mode 100755 optim/ls-vscode-cache.fish diff --git a/env.sh b/env.sh index 2bd1f7b..88f910b 100755 --- a/env.sh +++ b/env.sh @@ -35,10 +35,10 @@ lnsf () { local SYMLNK=$2 [ -z "$TARGET" ] && echo "$1 not exists" && return -1 local SYMDIR=$(dirname $SYMLNK) - if [ -n "$SYMDIR" ] && [ -L $SYMDIR ]; then + if [[ -n $SYMDIR && -L $SYMDIR ]]; then rm -rf $SYMDIR - mkdir -p $SYMDIR fi + mkdir -p $SYMDIR [ ! -L $SYMLNK ] && rm -rf $SYMLNK ln -sf $TARGET $SYMLNK } diff --git a/optim/ls-vscode-cache.fish b/optim/ls-vscode-cache.fish new file mode 100755 index 0000000..b63a825 --- /dev/null +++ b/optim/ls-vscode-cache.fish @@ -0,0 +1,8 @@ +#!/usr/bin/env fish + +set VSCP ~/.config/Code\ -\ OSS/User/workspaceStorage +echo $VSCP +for dir in (ls $VSCP) + echo (du -h -d 0 $VSCP/$dir) (jq '.folder // .configuration.external' $VSCP/$dir/workspace.json -r) +end | sort -hr + diff --git a/player/config/mpd/mpd.conf b/player/config/mpd/mpd.conf index d273d56..b57c995 100644 --- a/player/config/mpd/mpd.conf +++ b/player/config/mpd/mpd.conf @@ -34,7 +34,7 @@ db_file "~/.mpd/database" # The special value "syslog" makes MPD use the local syslog daemon. This # setting defaults to logging to syslog. # -log_file "~/.mpd/log" +log_file "/dev/null" # # This setting sets the location of the file which stores the process ID # for use of mpd --kill and some init scripts. This setting is disabled by diff --git a/player/install.sh b/player/install.sh index 8e288ea..9f560d0 100755 --- a/player/install.sh +++ b/player/install.sh @@ -15,9 +15,11 @@ case "$PM" in esac # symlink configuration -lnsf $DIR/config/mpd $XDG_CONFIG_HOME/mpd -lnsf $DIR/config/ncmpcpp $XDG_CONFIG_HOME/ncmpcpp -lnsf $DIR/config/mpv $XDG_CONFIG_HOME/mpv +lnsf $DIR/config/mpd/mpd.conf $XDG_CONFIG_HOME/mpd/mpd.conf +lnsf $DIR/config/mpv/mpv.conf $XDG_CONFIG_HOME/mpv/mpv.conf +lnsf $DIR/config/mpv/scripts/organize.lua $XDG_CONFIG_HOME/mpv/scripts/organize.lua +lnsf $DIR/config/ncmpcpp/bindings $XDG_CONFIG_HOME/ncmpcpp/bindings +lnsf $DIR/config/ncmpcpp/config $XDG_CONFIG_HOME/ncmpcpp/config # enable for current user systemctl --user enable mpd