diff options
-rw-r--r-- | .bashrc | 8 | ||||
-rw-r--r-- | .config/i3/config | 2 | ||||
-rw-r--r-- | .config/nvim/lua/user/lsp/common.lua | 3 | ||||
-rw-r--r-- | .config/nvim/lua/user/lsp/rust.lua | 3 | ||||
-rw-r--r-- | .config/picom/picom.conf | 4 | ||||
-rw-r--r-- | .root/tracked | 2 | ||||
-rwxr-xr-x | .root/usr/local/bin/encrypted | 6 | ||||
-rwxr-xr-x | .root/usr/local/bin/group-media | 104 | ||||
-rwxr-xr-x | .root/usr/local/bin/proxyctl | 16 |
9 files changed, 136 insertions, 12 deletions
@@ -1,8 +1,11 @@ + source /etc/profile source "$HOME/.cursed_bash.sh" source /usr/share/git/git-prompt.sh source /usr/share/doc/pkgfile/command-not-found.bash +eval "$(zoxide init --cmd cd bash)" + # application shortcuts alias ls="ls --color" alias dl="~/.local/bin/download" @@ -43,6 +46,11 @@ export JAVA_HOME="/usr/lib/jvm/default/" export PS1='[\[\e[1;32m\]\u@\h\[\e[0m\]:\[\e[36m\]\W\[\e[93m\]$(__git_ps1 "(%s" | cut_dots 15 ")")\[\e[37m\]]\[\e[38;5;183m\]\$\[\e[0m\] ' # dotfiles +# zerotier +export ZEROTIER_CENTRAL_TOKEN="/etc/zerotier/token" + + + GHC_PACKAGE_PATH="/usr/lib/ghc-9.0.2/package.conf.d" # Created by `pipx` on 2023-08-09 18:40:17 append_path '/home/main/.local/bin' diff --git a/.config/i3/config b/.config/i3/config index b1c7538..9e6b5cb 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -186,7 +186,7 @@ assign [class="dotnet"] workspace $ws7 assign [class="^Minecraft.*$"] workspace $ws7 assign [class="vlc"] workspace $ws8 assign [class="spotify"] workspace $ws8 -#assign [class="GigaQt"] workspace $ws9 +assign [class="Spotyfi"] workspace $ws8 #monitors diff --git a/.config/nvim/lua/user/lsp/common.lua b/.config/nvim/lua/user/lsp/common.lua index 91a663c..4358e2d 100644 --- a/.config/nvim/lua/user/lsp/common.lua +++ b/.config/nvim/lua/user/lsp/common.lua @@ -8,8 +8,9 @@ end define_sign({name = "DiagnosticSignError", text = '', hl = 'ErrorMsg'}) define_sign({name = "DiagnosticSignWarn", text = '', hl = 'IncSearch'}) -define_sign({name = "DiagnosticSignHint", text = '', hl = 'Search'}) +-- define_sign({name = "DiagnosticSignHint", text = '', hl = 'Search'}) -- define_sign({name = "DiagnosticSignInfo", text = ''}) +vim.fn.sign_define("DiagnosticSignHint", { texthl="DiagnosticSignHint", linehl = "Ignore", text = "", numhl = 'TermCursor' }) vim.fn.sign_define("DiagnosticSignInfo", { texthl="Ignore", text = "", numhl = 'TermCursor' }) vim.diagnostic.config{ diff --git a/.config/nvim/lua/user/lsp/rust.lua b/.config/nvim/lua/user/lsp/rust.lua index a192f1c..5232861 100644 --- a/.config/nvim/lua/user/lsp/rust.lua +++ b/.config/nvim/lua/user/lsp/rust.lua @@ -10,6 +10,9 @@ rust.setup{ cargo = { features = {"multithread"}, }, + check = { + command = "clippy", + }, }, } diff --git a/.config/picom/picom.conf b/.config/picom/picom.conf index 3ca757e..c5ae784 100644 --- a/.config/picom/picom.conf +++ b/.config/picom/picom.conf @@ -13,7 +13,7 @@ rounded-corners-exclude = [ ]; opacity-rule = [ "100: name *= 'YouTube'", - "100: name *= 'hub'", // not sus + "100: name *= 'Pornhub'", // not sus "100: name ~= 'ヰカちゃん♡♡~ – \\\\([0-9]+\\\\)'", // my girlfriend is more important than my rice "100: name ~= 'Вика Цой'", @@ -24,7 +24,7 @@ opacity-rule = [ // "75: class_g = 'Sakura' && name *= 'BashTOP'", // commented out for better times "84: class_g = 'Sakura' && focused", - "63: class_g = 'Sakura'", + "69: class_g = 'Sakura'", ]; blur = { method = "gaussian"; diff --git a/.root/tracked b/.root/tracked index e89a45f..9e62670 100644 --- a/.root/tracked +++ b/.root/tracked @@ -7,9 +7,9 @@ /usr/local/bin/grub-update /usr/local/bin/encrypted /usr/local/bin/proxyctl +/usr/local/bin/group-media /boot/efi/grub-workaround.sh - /etc/default/grub /etc/mkinitcpio.conf /etc/pacman.conf diff --git a/.root/usr/local/bin/encrypted b/.root/usr/local/bin/encrypted index b3132c6..73e2ff0 100755 --- a/.root/usr/local/bin/encrypted +++ b/.root/usr/local/bin/encrypted @@ -9,6 +9,12 @@ encrypted_datasets=("zfsroot/encrypted") function __mount() { for i in "${encrypted_datasets[@]}"; do + zfs list -o mounted "$i" | grep --quiet yes + if [ $? -eq 0 ]; then + echo "Dataset $i is already mounted. Skipping." + continue + fi + zfs load-key "$i"; if [ $? -ne 0 ]; then echo "Error importing the key! Aborting dataset ${i}" diff --git a/.root/usr/local/bin/group-media b/.root/usr/local/bin/group-media new file mode 100755 index 0000000..fb253e0 --- /dev/null +++ b/.root/usr/local/bin/group-media @@ -0,0 +1,104 @@ +#!/bin/bash + +set -e + +DIR="." +INTERACTIVE=0 +VERBOSE=0 +DO_THING=true + +while [ $# -gt 0 ]; do + case "$1" in + -h | --help) + echo "this is a script for grouping songs in 1 directory into subdirectories based on album." + echo "command line options:" + echo -e "\t-h, --help: print this message" + echo -e "\t-i, -ii: interactiveness. -i asks whether to create a directory, -ii asks before moving each file" + echo -e "\t -v, -vv: verboseness. -v prints all albums, -vv prints all moved files" + echo -e "\t-r, --dry-run: do not change anything, only print what would have been done. useless without verboseness." + echo -e "\t-d [DIR], --directory [DIR]: working directory for the script" + echo -e "I AM NOT responsible for anything that might go wrong in this script" + exit 0 + ;; + -d | --directory) + if ! test -z "$2"; then + DIR="$2" + else + echo "-d requires a value" + exit 1 + fi + shift 2 + ;; + -r | --dry-run) + DO_THING=false + shift + ;; + -i) + ((++INTERACTIVE)) + shift + ;; + -ii) + ((INTERACTIVE += 2)) + shift + ;; + -v) + ((++VERBOSE)) + shift + ;; + -vv) + ((VERBOSE += 2)) + shift + ;; + *) + echo "unknown argument: $1" + exit 1 + ;; + esac +done + +if ! which eyeD3 &> /dev/null; then + echo "eyeD3 must be available in PATH for this script to work. try installing it throug python-pip (or pipx)" + exit 1 +fi + +for i in "$DIR"/*; do + if test -f "$i"; then + ALB="$DIR"/$(eyeD3 "$i" | awk '/album:/{$1="";print $0}' | xargs); + if test -z "$ALB"; then + echo "song \"$i\" does not have an album." + continue + fi + if test 0 -eq $INTERACTIVE; then + if $DO_THING; then mkdir -p "$ALB"; fi + if test 1 -le $VERBOSE; then + echo "made directory $ALB" + fi + else + if ! test -d "$ALB"; then + unset cont; read -n 1 -p "mkdir \"$ALB\" ? [Y/n]" + echo + if [[ $cont =~ ^[Yy]$ ]] || [ -z $cont ]; then + if $DO_THING; then mkdir "$ALB"; fi + if test 1 -le $VERBOSE; then + echo "made directory \"$ALB\"" + fi + fi + fi + fi + + if test 2 -eq $INTERACTIVE; then + unset cont; read -n 1 -p "mv \"$i\" -> \"$ALB\" ? [Y/n]" cont + echo + if [[ $cont =~ ^[nN]$ ]]; then + continue + fi + fi + + if $DO_THING; then mv "$i" "$ALB"; fi + if test 2 -eq $VERBOSE; then + echo "moved \"$i\" to \"$ALB\"" + fi + fi +done + +# vim: filetype=bash diff --git a/.root/usr/local/bin/proxyctl b/.root/usr/local/bin/proxyctl index d46ec4f..839ef66 100755 --- a/.root/usr/local/bin/proxyctl +++ b/.root/usr/local/bin/proxyctl @@ -1,24 +1,24 @@ -#!/bin/env /bin/bash +#!/bin/bash . /etc/profile.d/proxy.sh function proxy_update_config() { if [ $UID -ne 0 ]; then echo "This command requires root privileges. Aborting..." - exit 1 + return 1 fi SRCD=/etc/sing-box ${SRCD}/libconfig_to_json.py ${SRCD}/libconfig ${SRCD}/config.json if [ $? -ne 0 ]; then echo "Failed to write config. Aborting..." - exit 1 + return 1 fi systemctl restart sing-box status=$(systemctl status sing-box) if [ $? -ne 0 ]; then echo "Failed to start sing-box. Manual intervention needed." - exit 1 + return 1 else echo "Success" fi @@ -41,7 +41,7 @@ function __help() { if [ $# -lt 1 ]; then echo "insufficient arguments. needed: . provided: $#" __help - exit 1 + return 1 fi if [ $1 = update ] || [ $1 = reload ]; then proxy_update_config @@ -57,9 +57,11 @@ elif [ $1 = start ] || [ $1 = stop ] || [ $1 = enable ] || [ $1 = disable ]; the echo "Failed to $1 sing-box" echo "otput of 'systemctl status sing-box':" echo ${STATUS_TEXT} - exit ${STATUS} + return ${STATUS} fi +elif [ $1 = "--help" ] || [ $1 = help ] || [ $1 = "-h" ]; then + __help else echo "Unknown command." - exit 1 + return 1 fi |