summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bash_profile3
-rwxr-xr-x.local/bin/chmodef1
-rwxr-xr-x.local/bin/convwall10
-rwxr-xr-x.local/bin/mpvsel2
-rwxr-xr-x.local/bin/shufwall2
-rw-r--r--.xinitrc2
6 files changed, 12 insertions, 8 deletions
diff --git a/.bash_profile b/.bash_profile
index f4d3fa94..54538100 100644
--- a/.bash_profile
+++ b/.bash_profile
@@ -41,6 +41,9 @@ export FZF_ALT_C_COMMAND="sudo find . -path '*/\.git' -prune -o -type d -print"
#export CM_OWN_CLIPBOARD=1
#export CM_MAX_CLIPS=8
+export SCRWIDTH=1600
+export SCRHEIGHT=900
+
# startx when login, should be put after environmental variables for .xinitrc to use
if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then
exec startx
diff --git a/.local/bin/chmodef b/.local/bin/chmodef
index 8163d300..be9b2934 100755
--- a/.local/bin/chmodef
+++ b/.local/bin/chmodef
@@ -1,4 +1,5 @@
#!/bin/sh
+# https://wiki.archlinux.org/title/File_permissions_and_attributes#Numeric_method
find "$@" -type d -execdir chmod 755 -- '{}' \+
find "$@" -type f -execdir chmod 644 -- '{}' \+
diff --git a/.local/bin/convwall b/.local/bin/convwall
index 21645240..9db84d06 100755
--- a/.local/bin/convwall
+++ b/.local/bin/convwall
@@ -1,9 +1,9 @@
#!/bin/sh
-# 16:9 screen aspect ratio
-# 16*100/9 == 177
-wratio=16
-hratio=9
+# target image aspect ratio
+wratio=$SCRWIDTH
+hratio=$SCRHEIGHT
+# chop how much from center
chopnum=99%
width=$(identify -format '%w' "$1")
@@ -27,6 +27,6 @@ if [ "$dim" -ne "$ratio" ]; then
# another approach is to use "$width" or "x$height" for geometry, current approach is more readable
convert "$1" -gravity center -background "$bgcolor" -extent "${width}x$height" "$2"
else
- echo 'same resolution ratio, no need to convert' >&2
+ echo 'same aspect ratio, no need to convert' >&2
exit 1
fi
diff --git a/.local/bin/mpvsel b/.local/bin/mpvsel
index c8b6c0d3..cfe743ae 100755
--- a/.local/bin/mpvsel
+++ b/.local/bin/mpvsel
@@ -4,7 +4,7 @@
# https://github.com/mpv-player/mpv/issues/7792
fps=30
-height=900
+height=$SCRHEIGHT
while getopts f:h: opt; do
case $opt in
diff --git a/.local/bin/shufwall b/.local/bin/shufwall
index 489b6307..33ec7269 100755
--- a/.local/bin/shufwall
+++ b/.local/bin/shufwall
@@ -6,4 +6,4 @@ else
file=$(find -L "$@" -maxdepth 1 -type f | shuf -n 1)
fi
-display -resize '1600x900' -backdrop -window root "$file"
+display -resize "${SCRWIDTH}x$SCRHEIGHT" -backdrop -window root "$file"
diff --git a/.xinitrc b/.xinitrc
index 4f38276b..0cb0481f 100644
--- a/.xinitrc
+++ b/.xinitrc
@@ -41,6 +41,7 @@ while true; do
sleep 1
done &
+shufwall &
#clipmenud &
dunst &
fcitx5 -d &
@@ -51,5 +52,4 @@ udiskie &
# without editing registry, using filter key, or other third party program
# see http://stereopsis.com/keyrepeat/
xset r rate 250 30 &
-shufwall &
exec dwm