summaryrefslogtreecommitdiffstats
path: root/.bin
diff options
context:
space:
mode:
Diffstat (limited to '.bin')
-rwxr-xr-x.bin/_music70
-rwxr-xr-x.bin/books10
-rwxr-xr-x.bin/cmus-to-m3u14
-rwxr-xr-x.bin/dot-sync41
-rwxr-xr-x.bin/synchronize-pub-dots1
-rwxr-xr-x.bin/x11-config15
-rwxr-xr-x.bin/x11-screen6
7 files changed, 65 insertions, 92 deletions
diff --git a/.bin/_music b/.bin/_music
deleted file mode 100755
index 6ef5ef8..0000000
--- a/.bin/_music
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/bin/sh
-
-
-MUSIC_DIR="${HOME}/music"
-MUSIC_LIST=
-MUSIC_FILE=
-MUSIC_YT_OPTIONS=
-
-log() {
- echo "[${0} ] ${@}"
-}
-
-main() {
- # arguments
- while getopts "c:" arg; do
- case "${arg}" in
- c)
- MUSIC_FILE="${OPTARG}"
- ;;
- h)
- exit 0
- ;;
- esac
- done
-
- # ensure parameters are correct
- [ ! -f "${MUSIC_FILE}" ] && exit 1
-
-
- while read -r line; do
-
- # skip comments
- line=$(echo ${line} | grep -v -e "^$" -e "^#")
- [ -z "${line}" ] && continue
-
- # retrieve playlist params
- url=$(echo "${line}" | cut -d " " -f 1)
- dir=$(echo "${line}" | cut -d " " -f 2)
-
- dir="${MUSIC_DIR}/${dir}"
-
- [ -d "${dir}" ] &&
- log "${dir}: directory already exists" &&
- continue
-
- mkdir "${dir}"
- log "${dir} ${url}: download"
-
- yt-dlp --rm-cache-dir >/dev/null
- yt-dlp \
- --extract-audio \
- --audio-format mp3 \
- --prefer-ffmpeg \
- --audio-quality 0 \
- --embed-thumbnail \
- --metadata-from-title "%(artist)s - %(title)s" \
- --no-warnings \
- --ignore-errors \
- --no-overwrites \
- --continue \
- --add-metadata \
- --user-agent "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" \
- --output "${dir}/'%(title)s.%(ext)s'" \
- "${url}"
-
-
- done < "${MUSIC_FILE}"
-}
-
-main ${@}
diff --git a/.bin/books b/.bin/books
new file mode 100755
index 0000000..1eccb57
--- /dev/null
+++ b/.bin/books
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -xe
+
+command -v fzf zathura
+
+while true; do
+ file=$(find books docs -iname "*.pdf" -o -iname "*.epub" | fzf)
+ zathura "${file}"
+done
diff --git a/.bin/cmus-to-m3u b/.bin/cmus-to-m3u
new file mode 100755
index 0000000..0eaf4a3
--- /dev/null
+++ b/.bin/cmus-to-m3u
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -xe
+
+root_dir="/home/qwd/music"
+
+test -f "${1}"
+test ! -d "${2}"
+
+echo "#EXTM3U" > "${2}"
+
+while read -r line; do
+ echo "${line}" | sed "s@${root_dir}/@@g" >> "${2}"
+done < "${1}"
diff --git a/.bin/dot-sync b/.bin/dot-sync
index 0643086..f12f878 100755
--- a/.bin/dot-sync
+++ b/.bin/dot-sync
@@ -1,29 +1,34 @@
#!/bin/sh
-set -x -e
+set -xe
export GIT_SSH_COMMAND="ssh -o ConnectTimeout=1 -o ConnectionAttempts=1"
-yadm pull
+yadm stash
+yadm pull --rebase
+yadm stash pop
yadm add -u
yadm add \
- $HOME/.bin \
- $HOME/.config/i3 \
- $HOME/.config/neomutt \
- $HOME/.config/newsboat \
- $HOME/.config/nvim \
- $HOME/.config/qutebrowser/*.py \
- $HOME/.config/qutebrowser/bookmarks \
- $HOME/.config/qutebrowser/greasemonkey \
- $HOME/.config/qutebrowser/quickmarks \
- $HOME/.config/qutebrowser/userscripts/*.py \
- $HOME/.config/sway \
- $HOME/.config/task \
- $HOME/.config/yadm \
- $HOME/.config/waybar \
- $HOME/.config/zk \
- $HOME/.public-keys
+ "${HOME}/.bin" \
+ "${HOME}/.config/cmus/playlists" \
+ "${HOME}/.config/i3" \
+ "${HOME}/.config/mpv/mpv.conf" \
+ "${HOME}/.config/mpv/scripts" \
+ "${HOME}/.config/neomutt" \
+ "${HOME}/.config/newsboat" \
+ "${HOME}/.config/nvim" \
+ "${HOME}/.config/qutebrowser/*.py" \
+ "${HOME}/.config/qutebrowser/bookmarks" \
+ "${HOME}/.config/qutebrowser/greasemonkey" \
+ "${HOME}/.config/qutebrowser/quickmarks" \
+ "${HOME}/.config/qutebrowser/userscripts/*.py" \
+ "${HOME}/.config/sway" \
+ "${HOME}/.config/task" \
+ "${HOME}/.config/yadm" \
+ "${HOME}/.config/waybar" \
+ "${HOME}/.config/zk" \
+ "${HOME}/.public-keys"
yadm push
diff --git a/.bin/synchronize-pub-dots b/.bin/synchronize-pub-dots
index b1f2e7b..8c7a9c4 100755
--- a/.bin/synchronize-pub-dots
+++ b/.bin/synchronize-pub-dots
@@ -35,7 +35,6 @@ allowed_patterns="-e ^.bin
-e ^.weechat/buflist.conf
-e ^.weechat/fset.conf
-e ^.weechat/logger.conf
- -e ^.weechat/weechat.conf
-e ^.xinitrc
-e ^.zshrc
"
diff --git a/.bin/x11-config b/.bin/x11-config
index efd47d7..554f00c 100755
--- a/.bin/x11-config
+++ b/.bin/x11-config
@@ -25,7 +25,7 @@ xset s off
xset s noblank
xset -dpms
-if [ $(uname -s) = "OpenBSD" ]; then
+if [ "$(uname -s)" = "OpenBSD" ]; then
xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation" 1
xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Button" 2
xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Axes" 6 7 4 5
@@ -35,6 +35,15 @@ fi
xsetroot -mod 2 2 -fg white -bg black
xsetroot -grey
-if [ -f "${wallpaper_file}" ]; then
- feh --bg-scale "${wallpaper_file}"
+monitors="$(xrandr --listactivemonitors | tail -n +2)"
+feh_args=""
+for i in seq $(echo monitors | wc -l); do
+ wallpaper=$(find .local/share/dot -iname "wallpaper*" | shuf -n 1)
+ if [ "${wallaper}" ]; then
+ feh_args="${feh_args} --bg-fill ${wallpaper} "
+ fi
+done
+
+if [ "${feh_args}" ]; then
+ feh ${feh_args}
fi
diff --git a/.bin/x11-screen b/.bin/x11-screen
index ea9e08d..38ee006 100755
--- a/.bin/x11-screen
+++ b/.bin/x11-screen
@@ -30,4 +30,10 @@ if [ "${hostname}" = "work-01" ]; then
xrandr --output DP3 --off
xrandr --addmode DP3 1920x1080
xrandr --output DP3 --mode 1920x1080 --same-as eDP1
+
+ case "${1}" in
+ vertical*)
+ xrandr --output DP3 --scale 1x1 --rotate left --right-of eDP1
+ ;;
+ esac
fi
remember that computers suck.