commit 6cc7ac04270c2eac2ef89f81cf050dc3be5ae9be
parent b863cf334f5313b8e1a920530eebe727af511a8e
Author: Christos Margiolis <christos@margiolis.net>
Date: Fri, 19 Nov 2021 20:31:29 +0200
script fixes
Diffstat:
10 files changed, 59 insertions(+), 53 deletions(-)
diff --git a/X/.xprofile b/X/.xprofile
@@ -1,8 +1,9 @@
#!/bin/sh
+tmsync &
xset r rate 300 50 &
slstatus &
setxkbmap -layout 'ca(multix),ee,ru(phonetic),gr' -option 'grp:shift_caps_toggle' &
musicpd &
-chsnd uaudio
+mixer -d8
setscreens &
diff --git a/freebsd/loader.conf.desktop b/freebsd/loader.conf.desktop
@@ -1,4 +1,7 @@
kern.vty="YES"
+kern.geom.label.disk_ident.enable="0"
+kern.geom.label.gptid.enable="0"
+kern.geom.label.ufsid.enable="0"
zfs_load="YES"
nvidia_name="nvidia"
nvidia_modeset_load="YES"
diff --git a/freebsd/rc.conf.desktop b/freebsd/rc.conf.desktop
@@ -7,6 +7,7 @@ zfs_enable="YES"
kld_list="linux nvidia nvidia modeset fuse sound snd_hda snd_ich snd_uadio"
sndiod_enable="YES"
tor_enable="NO"
+jail_enable="NO"
# bhyve shit
if_bridge_load="YES"
diff --git a/freebsd/rc.conf.laptop b/freebsd/rc.conf.laptop
@@ -1,10 +1,10 @@
hostname="knob"
wlans_iwm0="wlan0"
+synchronous_dhclient="YES"
ifconfig_wlan0="WPA DHCP"
#ifconfig_wlan0_ipv6="inet6 accept_rtadv"
sshd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
-kld_list="cuse snd_hda /boot/modules/i915kms.ko"
+kld_list="cuse sound snd_hda /boot/modules/i915kms.ko"
webcamd_enable="YES"
-tor_enable="YES"
diff --git a/scripts/.local/bin/chsnd b/scripts/.local/bin/chsnd
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-case $1 in
- uaudio) sysctl hw.snd.default_unit=8 ;;
- pcm) sysctl hw.snd.default_unit=0 ;;
- *) echo "${0##*/} {uaudio | pcm}"
-esac
diff --git a/scripts/.local/bin/extr b/scripts/.local/bin/extr
@@ -1,38 +1,33 @@
#!/bin/sh
-while getopts "hc" o; do case "${o}" in
- c) extracthere="True" ;;
- *) printf "Options:\\n -c: Extract archive into current directory rather than a new one.\\n" && exit ;;
-esac done
+usage() {
+ echo "usage: ${0##*/} [-d dir] file" 1>&2 && exit 1
+}
-if [ -z "$extracthere" ]; then
- archive="$(readlink -f "$*")" &&
- directory="$(echo "$archive" | sed 's/\.[^\/.]*$//')" &&
- mkdir -p "$directory" &&
- cd "$directory" || exit
-else
- archive="$(readlink -f "$(echo "$*" | cut -d' ' -f2)")"
-fi
+while getopts d: arg; do
+case "${arg}" in
+ d) dir="${OPTARG}" ;;
+ *) usage ;;
+esac
+done
+shift "$(expr ${OPTIND} - 1)"
-[ -z "$archive" ] && printf "Give archive to extract as argument.\\n" && exit
+archive="$(readlink -f ${1})"
+test -z "${archive}" && usage
+test -n "${dir}" && mkdir -p "${dir}" && cd "${dir}"
-if [ -f "$archive" ] ; then
- case "$archive" in
- *.tar.bz2|*.tbz2) tar xvjf "$archive" ;;
- *.tar.xz) tar -xf "$archive" ;;
- *.tar.gz|*.tgz) tar xvzf "$archive" ;;
- *.lzma) unlzma "$archive" ;;
- *.bz2) bunzip2 "$archive" ;;
- *.rar) unrar x -ad "$archive" ;;
- *.gz) gunzip "$archive" ;;
- *.tar) tar xvf "$archive" ;;
- *.zip) unzip "$archive" ;;
- *.Z) uncompress "$archive" ;;
- *.7z) 7z x "$archive" ;;
- *.xz) unxz "$archive" ;;
- *.exe) cabextract "$archive" ;;
- *) printf "extract: '%s' - unknown archive method\\n" "$archive" ;;
- esac
-else
- printf "File \"%s\" not found.\\n" "$archive"
-fi
+case "${archive}" in
+ *.tar.bz2|*.tbz2) tar xvjf "${archive}" ;;
+ *.tar.xz) tar -xf "${archive}" ;;
+ *.tar.gz|*.tgz) tar xvzf "${archive}" ;;
+ *.lzma) unlzma "${archive}" ;;
+ *.bz2) bunzip2 "${archive}" ;;
+ *.rar) unrar x -ad "${archive}" ;;
+ *.gz) gunzip "${archive}" ;;
+ *.tar) tar xvf "${archive}" ;;
+ *.zip) unzip "${archive}" ;;
+ *.Z) uncompress "${archive}" ;;
+ *.7z) 7z x "${archive}" ;;
+ *.xz) unxz "${archive}" ;;
+ *) echo "i don't know how to extract this" 1>&2 ;;
+esac
diff --git a/scripts/.local/bin/se b/scripts/.local/bin/se
@@ -1,3 +1,3 @@
#!/bin/sh
-du -a ~/.local/bin/* | awk '{print $2}' | fzf | xargs -r $EDITOR
+du -a ~/.local/bin/* | awk '{print $2}' | fzf | xargs -r ${EDITOR}
diff --git a/scripts/.local/bin/sysact b/scripts/.local/bin/sysact
@@ -7,5 +7,5 @@ renew_dwm kill -HUP $(pidof -s dwm)
reboot ${reb:-doas reboot}
shutdown ${shut:-doas shutdown -p now}"
-choice="$(echo "$cmds" | cut -d ' ' -f 1 | dmenu)" || exit 1
-`echo "$cmds" | grep "^$choice" | cut -d ' ' -f2-`
+choice="$(echo "${cmds}" | cut -d ' ' -f 1 | dmenu)" || exit 1
+`echo "${cmds}" | grep "^${choice}" | cut -d ' ' -f2-`
diff --git a/scripts/.local/bin/texpdf b/scripts/.local/bin/texpdf
@@ -1,5 +1,18 @@
#!/bin/sh
-# TODO: add bib option
-#pdflatex $1.tex && biber $1 && pdflatex $1.tex -o $1.pdf
-pdflatex $1.tex
+usage() {
+ echo "usage: ${0##*/} [-b] file" 1>&2 && exit 1
+}
+
+file_exists() {
+ test ! -f "${1}.tex" && echo "${1}.tex: file not found" && exit 1
+}
+
+test ${#} -eq 0 && usage
+if [ ${1} = "-b" ]; then
+ file_exists "${2}"
+ pdflatex ${2}.tex && biber ${2} && pdflatex ${2}.tex -o ${2}.pdf
+else
+ file_exists "${1}"
+ pdflatex ${1}.tex
+fi
diff --git a/scripts/.local/bin/walset b/scripts/.local/bin/walset
@@ -1,6 +1,6 @@
#!/bin/sh
-bgloc="$HOME/.local/share/bg"
-[ -f "$1" ] && ln -sf "$(readlink -f "$1")" "$bgloc" &&
- nfy "$bgloc" "Changing wallpaper..."
-xwallpaper --zoom "$(readlink -f "$bgloc")" >/dev/null
+bgloc="${HOME}/.local/share/bg"
+test -f "${1}" && ln -sf "$(readlink -f "${1}")" "${bgloc}" &&
+nfy "${bgloc}" "Changing wallpaper..."
+xwallpaper --zoom "$(readlink -f "${bgloc}")" >/dev/null