diff options
38 files changed, 220 insertions, 177 deletions
diff --git a/.config/Thunar/accels.scm b/.config/Thunar/accels.scm index 638a9f3..fb9c2c7 100644 --- a/.config/Thunar/accels.scm +++ b/.config/Thunar/accels.scm @@ -1,4 +1,4 @@ -; thunar GtkAccelMap rc-file -*- scheme -*- +; Thunar GtkAccelMap rc-file -*- scheme -*- ; this file is an automated accelerator map dump ; ; (gtk_accel_path "<Actions>/ThunarActionManager/restore" "") @@ -51,7 +51,6 @@ ; (gtk_accel_path "<Actions>/ThunarWindow/cancel-search" "Escape") ; (gtk_accel_path "<Actions>/ThunarStandardView/select-by-pattern" "<Primary>s") ; (gtk_accel_path "<Actions>/ThunarStandardView/rename" "F2") -; (gtk_accel_path "<Actions>/ThunarStandardView/configure-columns" "") ; (gtk_accel_path "<Actions>/ThunarStandardView/create-document" "") ; (gtk_accel_path "<Actions>/ThunarShortcutsPane/sendto-shortcuts" "<Primary>d") ; (gtk_accel_path "<Actions>/ThunarActionManager/move-to-trash" "") diff --git a/.config/X11/Xresources b/.config/X11/Xresources index 294f1fb..fcc61aa 100644 --- a/.config/X11/Xresources +++ b/.config/X11/Xresources @@ -1,3 +1,6 @@ +Xcursor.size: 40 +Xcursor.theme: Banana + !! Transparency (0-1): st.alpha: 0.95 st.alphaOffset: 0.1 @@ -7,7 +10,7 @@ st.font: MesloLGS Nerd\ Font:size=17 ! st.termname: st-256color ! st.borderpx: 2 -st.background: #1d1f21 +/* st.background: #1d1f21 */ /* name dark light */ /* black 0 8 */ diff --git a/.config/X11/xprofile b/.config/X11/xprofile index 29250ae..3e71b20 100644 --- a/.config/X11/xprofile +++ b/.config/X11/xprofile @@ -6,9 +6,8 @@ echo "Sourced: $(date)" >> ~/.local/state/xprofile.logs xrdb "${XDG_CONFIG_HOME:-$HOME/.config}/X11/Xresources" & xrdbpid=$! numlockx on & -setdp & -autostart="copyq dunst pipewire syncthing remapd" +autostart="copyq dunst pipewire syncthing remapd gammastep setdp prime-offload" for program in $autostart; do pidof -sx "$program" || "$program" & diff --git a/.config/gotop/user.json b/.config/gotop/user.json new file mode 100644 index 0000000..fcc44ec --- /dev/null +++ b/.config/gotop/user.json @@ -0,0 +1,22 @@ +{ + "Fg": 7, + "Bg": -1, + + "BorderLabel": 7, + "BorderLine": 6, + + "CPULines": [4, 3, 2, 1, 5, 6, 7, 8], + + "BattLines": [4, 3, 2, 1, 5, 6, 7, 8], + + "MemLines": [5, 11, 4, 3, 2, 1, 6, 7, 8], + + "ProcCursor": 4, + + "Sparklines": [4, 5], + + "DiskBar": 7, + + "TempLow": 2, + "TempHigh": 1 +} diff --git a/.config/gtk-3.0/settings.ini b/.config/gtk-3.0/settings.ini index 1dea2a0..ce89467 100644 --- a/.config/gtk-3.0/settings.ini +++ b/.config/gtk-3.0/settings.ini @@ -4,12 +4,12 @@ gtk-icon-theme-name=Gruvbox-Plus-Dark gtk-sound-theme-name=Smooth gtk-application-prefer-dark-theme=true # GTK3 ignores bold or italic attributes. -gtk-font-name=Fira Sans 14 +gtk-font-name=Fira Sans 16 gtk-menu-images=1 gtk-button-images=1 -gtk-toolbar-style=GTK_TOOLBAR_ICONS -gtk-cursor-theme-name=Qogir-dark -gtk-cursor-theme-size=24 +gtk-toolbar-style=GTK_TOOLBAR_BOTH +gtk-cursor-theme-name=Banana +gtk-cursor-theme-size=40 gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR gtk-enable-event-sounds=1 gtk-enable-input-feedback-sounds=1 @@ -17,4 +17,3 @@ gtk-xft-antialias=1 gtk-xft-hinting=1 gtk-xft-hintstyle=hintmedium gtk-xft-rgba=none -gtk-modules=canberra-gtk-module:gail:atk-bridge diff --git a/.config/htop/htoprc b/.config/htop/htoprc index 4a3ad55..1679191 100644 --- a/.config/htop/htoprc +++ b/.config/htop/htoprc @@ -8,7 +8,7 @@ hide_userland_threads=0 hide_running_in_container=0 shadow_other_users=0 show_thread_names=0 -show_program_path=1 +show_program_path=0 highlight_base_name=0 highlight_deleted_exe=1 shadow_distribution_path_prefix=0 diff --git a/.config/i3/config b/.config/i3/config index 47a3b3e..f6739da 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -70,6 +70,7 @@ bindsym $super+x exec --no-startup-id toggle-xeyes bindsym $super+i exec --no-startup-id sh -c 'xdotool type "$(grep -v "^#\|^\s*$" ~/Documents/Notes/bookmarks.txt | tac | dmenu -i -l 50 | cut -d\ -f1)"' bindsym $super+Shift+z exec --no-startup-id dmenu-zeal bindsym $super+Shift+b exec --no-startup-id librewolf-open "$(xprint)" +bindsym $super+Shift+v exec --no-startup-id st -c "dropdown_clipboard" -e sh -c 'xclip -sel clip -o >/tmp/clipboard && nvim /tmp/clipboard && xclip -sel clip -i /tmp/clipboard || read -r ans' bindsym $super+period exec --no-startup-id sh -c 'xdotool click --clearmodifiers 1 && xdotool keyup super' bindsym $super+slash exec --no-startup-id sh -c 'xdotool click --clearmodifiers 3 && xdotool keyup super' bindsym $super+comma exec --no-startup-id scrcpy-k @@ -474,9 +475,9 @@ for_window [class="dropdown_*|tridactyl_*"] floating enable for_window [class="dropdown_*|tridactyl_*"] move scratchpad for_window [class="dropdown_*|tridactyl_*"] sticky enable for_window [class="dropdown_*|tridactyl_*"] scratchpad show +for_window [class="dropdown_tmuxdd"] resize set 1600 900 for_window [class="dropdown_*"] move position center for_window [class="dropdown_tmuxdd"] scratchpad hide -# for_window [class="dropdown_tmuxdd"] resize set 625 450 # for_window [class="dropdown_dropdowncalc"] resize set 800 300 # for_window [class="dropdown_tmuxdd"] border pixel 3 # for_window [class="dropdown_dropdowncalc"] border pixel 2 diff --git a/.config/ipython/profile_default/history-corrupt-2024-12-09T13.25.20.800268.sqlite b/.config/ipython/profile_default/history-corrupt-2024-12-09T13.25.20.800268.sqlite Binary files differnew file mode 100644 index 0000000..77a1302 --- /dev/null +++ b/.config/ipython/profile_default/history-corrupt-2024-12-09T13.25.20.800268.sqlite diff --git a/.config/ipython/profile_default/history-corrupt-2024-12-09T13.44.23.964600.sqlite b/.config/ipython/profile_default/history-corrupt-2024-12-09T13.44.23.964600.sqlite Binary files differnew file mode 100644 index 0000000..4736b07 --- /dev/null +++ b/.config/ipython/profile_default/history-corrupt-2024-12-09T13.44.23.964600.sqlite diff --git a/.config/ipython/profile_default/history.sqlite b/.config/ipython/profile_default/history.sqlite Binary files differindex 3f42fc7..294b3ed 100644 --- a/.config/ipython/profile_default/history.sqlite +++ b/.config/ipython/profile_default/history.sqlite diff --git a/.config/keepassxc/keepassxc.ini b/.config/keepassxc/keepassxc.ini index a966b00..4350875 100644 --- a/.config/keepassxc/keepassxc.ini +++ b/.config/keepassxc/keepassxc.ini @@ -12,6 +12,7 @@ CustomProxyLocation= Enabled=false [GUI] +ApplicationTheme=dark CheckForUpdates=false CompactMode=false HidePreviewPanel=true diff --git a/.config/lf/lfrc b/.config/lf/lfrc index daf9b1f..b8bf800 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -37,6 +37,15 @@ cmd on-cd &{{ echo "$PWD" >> ${XDG_DATA_HOME:-$HOME/.local/share}/cdhist }} +cmd delete ${{ + clear; tput cup $(($(tput lines)/3)); tput bold + set -f + printf "%s\n\t" "$fx" + printf "delete?[y/N] " + read ans + [ $ans = "y" ] && rm -rf -- $fx +}} + cmd extract ${{ # extract the current file with the right command # (xkcd link: https://xkcd.com/1168/) @@ -99,7 +108,7 @@ map <a-s> :source ~/.config/lf/lfrc map <tab> :toggle; down map <backtab> :toggle; up map Z :toggle; up -map <c-j> select_eval "fzf --reverse --header-first --header='Jump to location'" +map <c-j> select_eval "fzf --reverse --query '!/$ ' --header-first --header='Jump to location'" map <backspace> ${{ lf -remote "send $id select \"$(cat ${XDG_DATA_HOME:-$HOME/.local/share}/openhist | fzf --tac --reverse --header-first --header='File History')\"" }} map <c-k> ${{ lf -remote "send $id cd \"$(cat ${XDG_DATA_HOME:-$HOME/.local/share}/cdhist | diff --git a/.config/nvim/templates/_default.tex b/.config/nvim/templates/_default.tex index 397e28e..dbbf53a 100644 --- a/.config/nvim/templates/_default.tex +++ b/.config/nvim/templates/_default.tex @@ -1,7 +1,14 @@ \documentclass{article} +\usepackage[margin=0.5in]{geometry} +\usepackage{libertine} + +\title{<++>} +\author{<++>} \begin{document} +\maketitle + <++> \end{document} diff --git a/.config/nvim/templates/article.tex b/.config/nvim/templates/article.tex deleted file mode 100644 index a821909..0000000 --- a/.config/nvim/templates/article.tex +++ /dev/null @@ -1,11 +0,0 @@ -\documentclass{article} - -\title{<++>} -\author{<++>} - -\begin{document} -\maketitle - -<++> - -\end{document} diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index 1c4c7fc..e60a16b 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -38,7 +38,7 @@ sudoedit() { } lfcd () { - [ $# -gt 0 ] && [ -z "$1" ] && return 2 + [ $# -gt 0 ] && [ -z "$1" ] && return 3 # cd "$(command lf -print-last-dir "$@")" tmp="$(mktemp)" @@ -47,7 +47,7 @@ lfcd () { dir="$(cat "$tmp")" rm -f "$tmp" [ -d "$dir" ] || return - [ "$dir" != "$PWD" ] || return + [ "$dir" != "$PWD" ] || return 0 cd "$dir" fi } @@ -75,6 +75,7 @@ alias cp='cp -iv' alias mv='mv -iv' alias du='du -h' alias mkdir='mkdir -pv' +alias rmdir='rmdir -v' alias watch='watch -c -n 1 ' alias wget='wget -c' alias fzf='fzf --ansi' diff --git a/.config/shell/bm-dirs b/.config/shell/bm-dirs index 4918a18..93476eb 100644 --- a/.config/shell/bm-dirs +++ b/.config/shell/bm-dirs @@ -27,11 +27,11 @@ vrc ~/Dev/sites/vikas.rocks/content vrl ~/Dev/sites/vikas.rocks/layouts vrp ~/Dev/sites/vikas.rocks/public td ~/Dev/test -gd ~/GDrive/vartak/CS -gf ~/GDrive/vartak/CS/practical-files/sem5 -gp ~/GDrive/vartak/CS/practical-notes/sem5 +gd ~/GDrive/vartak/CS/sem6 +gf ~/GDrive/vartak/CS/sem6/practicals +gp ~/GDrive/vartak/CS/sem6/journal gz ~/GDrive/vartak/CS/practical-zip/sem5 -gn ~/GDrive/vartak/CS/notes/sem5 +gn ~/GDrive/vartak/CS/sem6/notes rs ~/GDrive/vartak/results ph ~/Phone stv ~/Phone/.stversions diff --git a/.config/shell/profile b/.config/shell/profile index 1393c45..46bbb9b 100644 --- a/.config/shell/profile +++ b/.config/shell/profile @@ -51,7 +51,7 @@ export QT_FONT_DPI=112 export SDCV_PAGER='less -R --quit-if-one-screen' export HTTP_HOME='https://www.duckduckgo.com' export CHROME_EXECUTABLE='chromium' -export FZF_DEFAULT_COMMAND="find -L . ! -wholename '*.git*' \( -type d -printf '%p/\n' , ! -type d -print \)" +export FZF_DEFAULT_COMMAND="find -H . ! -wholename '*.git*' \( -type d -printf '%p/\n' , ! -type d -print \)" export FZF_DEFAULT_OPTS=" --history='$XDG_DATA_HOME/fzf/history' --preview='\$PREVIEWER {}' --preview-window=hidden diff --git a/.config/zathura/zathurarc b/.config/zathura/zathurarc index 064e442..6e4930e 100644 --- a/.config/zathura/zathurarc +++ b/.config/zathura/zathurarc @@ -1,6 +1,8 @@ map u scroll half-up map d scroll half-down map D toggle_page_mode +map b toggle_statusbar +map <C-l> nohlsearch map > rotate rotate-cw map < rotate rotate-ccw diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 3f7ed30..f482fd2 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -34,6 +34,7 @@ setopt histignorespace # ignore lines starting with a space # Enable colors and change prompt: autoload -U colors && colors PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%1~%{$fg[red]%}]%{$reset_color%}$%b " +#PS1=$'\n'"%B%{$fg[red]%}[%{$fg[green]%}%?%{$fg[red]%}] %{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~"$'\n'"%{$fg[red]%}>%{$reset_color%}%b " #PS1="%B%{$fg[red]%} %~ >%{$fg[yellow]%}%{$reset_color%}%b " [ -n "$LF_LEVEL" ] && PS1="$PS1(lf: $LF_LEVEL) " @@ -95,7 +96,7 @@ stty -ixon _command_fail_hook() { - [ $? != 1 ] && return + [ $? = 1 ] || return if [ -n "$TMUX" ]; then tmux send-keys C-p elif [ -n "$XDOTOOL_WINDOW_ID" ]; then @@ -186,11 +187,11 @@ _fzf-cd-widget() { cdpath="$(eval "${FZF_CD_COMMAND:-find -L . -type d ! -wholename '*.git*' -printf '%p/\n'}" | FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS --reverse --height 40% $FZF_CD_OPTS" fzf | sed 's/"/\\\"/')" - [ -z "$cdpath" ] && { zle reset-prompt; return; } + [ -z "$cdpath" ] && { zle reset-prompt; return; } zle push-line - BUFFER="cd -- \"$cdpath\"" + BUFFER="cd -- \"$cdpath\"" zle reset-prompt - zle accept-line + zle accept-line } zle -N fzf-cd-widget _fzf-cd-widget bindkey '^[c' fzf-cd-widget @@ -231,7 +232,7 @@ _get-help() { cmd=(${=BUFFER}) zle push-line case "${cmd[1]}" in - gh|hugo|npm|git) BUFFER="help ${cmd[1]}-${cmd[2]}" ;; + docker|gh|hugo|npm|git) BUFFER="help ${cmd[1]}-${cmd[2]}" ;; *) BUFFER="get-help $cmd" ;; esac zle accept-line @@ -266,8 +267,8 @@ alias sp='sudo pacman' alias sv='sudo sv' alias mmv='noglob zmv -W' alias s='sudo ' -alias mirror='sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist' -alias mirrord='sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist' +alias mirror='sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist-arch' +alias mirrord='sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist-arch' alias cleanup='sudo pacman -Rns $(pacman -Qtdq)' alias fixpacman='sudo rm /var/lib/pacman/db.lck' alias gtypist="gtypist $GTYPIST_OPTS" @@ -289,5 +290,5 @@ f() { # alias ssudo='sudofu ' # Load syntax highlighter; should be last. -source "$ZDOTDIR/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh" +source "/home/master/.config/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh" @@ -12,7 +12,7 @@ !/.config/gh/config.yml shortcutrc -shortcuts.* +shortcuts* !/.config/shell /.config/shell/* @@ -53,7 +53,6 @@ shortcuts.* !/.config/i3blocks !/.config/jgmenu !/.config/keepassxc -!/.config/Thunar !/.config/zathura !/.config/Zeal diff --git a/.local/bin/backup b/.local/bin/backup deleted file mode 100755 index 8f6e00d..0000000 --- a/.local/bin/backup +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -sudo cryptsetup open /dev/sdb1 backup -sudo mount --mkdir /dev/mapper/backup /mnt/backup -backup="/mnt/backup/$(hostname)" -[ -d "$backup" ] || - { echo "$0: directory doesn't exist: $backup" >&2; exit 1; } - -cd ~ || exit -rsync -Plru --delete \ - .config \ - .git \ - .gnupg \ - .local \ - .librewolf \ - .ssh \ - bin \ - DCIM \ - Dev \ - Documents \ - Downloads \ - GDrive \ - Music \ - Phone \ - Pictures \ - repos \ - Videos \ - "$backup/home/$USER/" - -find . -maxdepth 1 \( -type f -o -type l \) -exec rsync -Plu {} "$backup/home/$USER" \; - -echo "Backing up /etc directory..." -sudo rsync -Plruq --delete /etc "$backup" diff --git a/.local/bin/development/dev b/.local/bin/development/dev index 76f1772..bcb5b46 100755 --- a/.local/bin/development/dev +++ b/.local/bin/development/dev @@ -33,6 +33,7 @@ md_test() { pandoc -t pdf "$file" | zathura -; } tex_compile() { pdflatex -output-directory="$(dirname "$file")" "$file"; } tex_clean() { find "$(dirname "${1}")" -regex \ '.*\(_minted.*\|.*\.\(4tc\|xref\|tmp\|pyc\|pyg\|pyo\|fls\|vrb\|fdb_latexmk\|bak\|swp\|aux\|log\|synctex\(busy\)\|lof\|lot\|maf\|idx\|mtc\|mtc0\|nav\|out\|snm\|toc\|bcf\|run\.xml\|synctex\.gz\|blg\|bbl\)\)' -delete; } +cls_compile() { file="${file%.cls}.tex"; tex_compile "$@"; } html_format() { tidy -q "$file" 2>/dev/null; } html_lint() { tidy -q "$file" >/dev/null; } html_run() { w3m "$file"; } @@ -138,6 +139,7 @@ case $filetype in text/x-shellscript) filetype_ext="sh" ;; text/html) filetype_ext="html" ;; application/javascript) filetype_ext="js" ;; + application/json) filetype_ext="json" ;; text/x-php) filetype_ext="php" ;; text/x-awk) filetype_ext="awk" ;; esac @@ -150,17 +152,15 @@ else fi execute_task() { - [ "$NO_BASENAME" != 1 ] && { - file_task="${file_ext}_${action}" - [ "${tasks#*"[$file_task]"}" != "$tasks" ] && - { $file_task; local ret=$?; local tasked=1; } - } - [ "$tasked" != 1 ] && { - filetype_task="${filetype_ext}_${action}" - [ "${tasks#*"[$filetype_task]"}" != "$tasks" ] && - { $filetype_task; local ret=$?; local tasked=1; } - } - [ "$tasked" != 1 ] && return 1 + file_task="${file_ext}_${action}" + filetype_task="${filetype_ext}_${action}" + if [ "$NO_BASENAME" != 1 ] && [ "${tasks#*"[$file_task]"}" != "$tasks" ]; then + $file_task; ret=$? + elif [ "${tasks#*"[$filetype_task]"}" != "$tasks" ]; then + $filetype_task; ret=$? + else + return 1 + fi [ "$ret" != 0 ] && printf "\nshell returned %s\n" "$ret" >&2 return 0 } diff --git a/.local/bin/development/github-repo-size b/.local/bin/development/github-repo-size new file mode 100755 index 0000000..0cedd88 --- /dev/null +++ b/.local/bin/development/github-repo-size @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "$1" | perl -ne 'print $1 if m!([^/]+/[^/]+?)(?:\.git)?$!' | xargs -i curl -s -k https://api.github.com/repos/'{}' | grep size diff --git a/.local/bin/development/gitpush b/.local/bin/development/gitpush index 97aa43b..0af8e20 100755 --- a/.local/bin/development/gitpush +++ b/.local/bin/development/gitpush @@ -1,10 +1,20 @@ #!/bin/sh -case "$(git config --get remote.origin.url)" in - *csstudent41*) sshadd ~/.ssh/github.com_id_ed25519 ;; - *labstudent41*) sshadd ~/.ssh/labstudent41_id_ed25519 ;; -esac - -git add --all -git commit # --allow-empty-message -git push -u origin +push_to_remote() { + case "$(git config --get remote.origin.url)" in + *csstudent41*) sshadd ~/.ssh/github.com_id_ed25519 ;; + *labstudent41*) sshadd ~/.ssh/labstudent41_id_ed25519 ;; + *vtc-tech*) sshadd ~/.ssh/vartaktechclub_id_ed25519 ;; + esac + + git add --all + git commit + git push -u origin +} + +[ -z "$1" ] && { push_to_remote; exit; } + +for dir in "$@"; do + cd "$dir" || exit 1 + push_to_remote +done diff --git a/.local/bin/open b/.local/bin/open index a996105..9b83265 100755 --- a/.local/bin/open +++ b/.local/bin/open @@ -11,7 +11,7 @@ for file in "$@"; do *.html) ${BROWSER:-w3m} "$file" ;; *.pl.txt) fpl "$file" ;; *.txt|*.description) ${PAGER:-less} "$file" ;; - *.md) glow --pager "$file" ;; + *.md) glow --pager --width $(("$(tput cols)" - 5)) "$file" ;; *.css|*.json|*.ipynb|*.vim|*.lua|*.iso|*.zip) LESSOPEN="|preview %s" less -r "$file" ;; *.srt) fzf-subtitles -o "$file" ;; *.dig) setsid -f digital "$file" ;; diff --git a/.local/bin/preview b/.local/bin/preview index f0cedb0..2968843 100755 --- a/.local/bin/preview +++ b/.local/bin/preview @@ -23,9 +23,9 @@ case "$1" in *.png|*.jpg|*.jpeg|*.webp|*.mp3|*.ogg|*.mp4|*.mkv|*.webm) mediainfo -- "$1" ;; *.info.json) jq -C . "$1" ;; *.json|*.ipynb) highlight --syntax=json -- "$1" ;; - *.tgz|*.tar.gz) tar tzf "$1" ;; + *.tar.gz|*.tgz) tar tzf "$1" ;; *.tar.bz2|*.tbz2) tar tjf "$1" ;; - *.tar.txz|*.txz) xz --list "$1" ;; + *.tar.xz|*.txz) tar tJf "$1" ;; *.tar) tar tf "$1" ;; *.zip|*.jar|*.war|*.ear|*.oxt) unzip -l "$1" ;; *.rar) unrar l "$1" ;; diff --git a/.local/bin/setbg b/.local/bin/setbg index b636a37..c288895 100755 --- a/.local/bin/setbg +++ b/.local/bin/setbg @@ -1,18 +1,41 @@ ---2024-10-23 16:26:25-- https://github.com/LukeSmithxyz/voidrice/blob/master/.local/bin/setbg -Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt' -Resolving github.com (github.com)... 20.207.73.82 -Connecting to github.com (github.com)|20.207.73.82|:443... connected. -HTTP request sent, awaiting response... 200 OK -Length: unspecified [text/html] -Saving to: ‘setbg’ - - 0K .......... .......... .......... .......... .......... 3.47M - 50K .......... .......... .......... .......... .......... 9.00M - 100K .......... .......... .......... .......... .......... 10.7M - 150K .......... .......... .......... .......... .......... 10.7M - 200K .......... .......... .......... .......... .......... 10.9M - 250K .......... .......... .......... .......... .......... 11.2M - 300K .......... .......... .......... ....... 10.8M=0.04s - -2024-10-23 16:26:25 (8.07 MB/s) - ‘setbg’ saved [345695] +#!/bin/sh +# This script does the following: +# Run by itself, set the wallpaper (at X start). +# If given a file, set that as the new wallpaper. +# If given a directory, choose random file in it. +# If wal is installed, also generates a colorscheme. + +# Location of link to wallpaper link. +bgloc="${XDG_DATA_HOME:-$HOME/.local/share}/bg" + +# Configuration files of applications that have their themes changed by pywal. +dunstconf="${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc" +zathuraconf="${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc" + +# Give -s as parameter to make notifications silent. +while getopts "s" o; do case "${o}" in + s) silent='1' ;; +esac done + +shift $((OPTIND - 1)) + +trueloc="$(readlink -f "$1")" && +case "$(file --mime-type -b "$trueloc")" in + image/* ) ln -sf "$trueloc" "$bgloc" && [ -z "$silent" ] && notify-send -i "$bgloc" "Changing wallpaper..." ;; + inode/directory ) ln -sf "$(find "$trueloc" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$bgloc" && [ -z "$silent" ] && notify-send -i "$bgloc" "Random Wallpaper chosen." ;; + *) [ -z "$silent" ] && notify-send "🖼️ Error" "Not a valid image or directory." ; exit 1;; +esac + +# If pywal is installed, use it. +if command -v wal >/dev/null 2>&1 ; then + wal -n -i "$(readlink -f $bgloc)" -o "${XDG_CONFIG_HOME:-$HOME/.config}/wal/postrun" >/dev/null 2>&1 +# If pywal is removed, return config files to normal. +else + [ -f "$dunstconf.bak" ] && unlink "$dunstconf" && mv "$dunstconf.bak" "$dunstconf" + [ -f "$zathuraconf.bak" ] && unlink "$zathuraconf" && mv "$zathuraconf.bak" "$zathuraconf" +fi + +xwallpaper --zoom "$bgloc" +# If running, dwm hit the key to refresh the color scheme. +pidof dwm >/dev/null && xdotool key super+F5 diff --git a/.local/bin/shorts/ec b/.local/bin/shorts/ec new file mode 100755 index 0000000..bc6e7d5 --- /dev/null +++ b/.local/bin/shorts/ec @@ -0,0 +1,5 @@ +#!/bin/sh + +# edit-clipboard: edit the content of clipboard + +xclip -sel clip -o >/tmp/clipboard && nvim /tmp/clipboard && xclip -sel clip -i /tmp/clipboard diff --git a/.local/bin/shorts/qr b/.local/bin/shorts/qr new file mode 100755 index 0000000..4203e71 --- /dev/null +++ b/.local/bin/shorts/qr @@ -0,0 +1,4 @@ +#!/bin/sh + +qrencode "$@" -o /tmp/qr.png +${OPENER:-xdg-open} /tmp/qr.png diff --git a/.local/bin/shorts/refcitx b/.local/bin/shorts/refcitx index 668952c..1d104bf 100755 --- a/.local/bin/shorts/refcitx +++ b/.local/bin/shorts/refcitx @@ -1,7 +1,8 @@ #!/bin/sh -notify-send "Starting Fcitx..." +id="$(notify-send --print-id "Starting Fcitx...")" fcitx sleep 1 remap -notify-send "Fcitx Started" +fcitx-remote -t +notify-send --replace-id="$id" "✅ Fcitx Started" diff --git a/.local/bin/shorts/sync-server b/.local/bin/shorts/sync-server deleted file mode 100755 index 641db9c..0000000 --- a/.local/bin/shorts/sync-server +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -sshadd "$HOME/.ssh/${1}_id_ed25519" -sync() { rsync -PRru --delete --exclude "*.git" "$@"; } - -sync \ - "${XDG_CONFIG_HOME:-$HOME/.config}/./vim/vimrc" \ - "${XDG_CONFIG_HOME:-$HOME/.config}/./tmux/tmux.conf" \ - "${XDG_CONFIG_HOME:-$HOME/.config}/./shell/aliasrc" \ - "${XDG_CONFIG_HOME:-$HOME/.config}/./shell/inputrc" \ - "${XDG_CONFIG_HOME:-$HOME/.config}/./shell/server.profile" \ - "${1}:.config" diff --git a/.local/bin/shorts/syncdrive b/.local/bin/shorts/syncdrive deleted file mode 100755 index 3d010cc..0000000 --- a/.local/bin/shorts/syncdrive +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -rclone -v sync --delete-excluded --exclude=".git/**" ~/GDrive gdrive: diff --git a/.local/bin/shorts/synchs b/.local/bin/shorts/synchs deleted file mode 100755 index 244dd48..0000000 --- a/.local/bin/shorts/synchs +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -sync-server rpi - -# rsync -u ~/.config/lf/lfrc /tmp/lfrc -# sed -i '/set icons/d' /tmp/lfrc -# rsync -Pu /tmp/lfrc rpi:.config/lf/ diff --git a/.local/bin/shorts/synctab b/.local/bin/shorts/synctab deleted file mode 100755 index 1e44419..0000000 --- a/.local/bin/shorts/synctab +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -sshadd ~/.ssh/tab_id_ed25519 -sync() { rsync -Pru --delete --exclude "*.git" "$@"; } - -sync ~/GDrive/ tab:GDrive/ -sync "${XDG_VIDEOS_DIR:-$HOME/Videos}" tab:Videos/ - -sync -R \ - "${XDG_DOCUMENTS_DIR:-$HOME/Documents}/./allreader" \ - "${XDG_DOCUMENTS_DIR:-$HOME/Documents}/./latex" \ - "${XDG_DOCUMENTS_DIR:-$HOME/Documents}/./Notes/bookmarks.txt" \ - tab:Documents/ - -sync \ - "${XDG_MUSIC_DIR:-$HOME/Music}/Piano" \ - "${XDG_MUSIC_DIR:-$HOME/Music}/Devotional" \ - tab:Music/ - diff --git a/.local/bin/shorts/syslogcat b/.local/bin/shorts/syslogcat new file mode 100755 index 0000000..c9763c7 --- /dev/null +++ b/.local/bin/shorts/syslogcat @@ -0,0 +1,3 @@ +#!/bin/sh + +awk '{ printf "%s: %s\n", FILENAME, $0 }' /var/log/*/current | sort -k2 | less +G -X diff --git a/.local/bin/shorts/xprint b/.local/bin/shorts/xprint index 12156f2..74fc666 100755 --- a/.local/bin/shorts/xprint +++ b/.local/bin/shorts/xprint @@ -2,7 +2,7 @@ [ -n "$TERMUX_VERSION" ] && { termux-clipboard-get; exit; } -xclip -out -selection clipboard 2>/dev/null || -xclip -out -selection secondry 2>/dev/null || xclip -out -selection primary 2>/dev/null || +xclip -out -selection secondry 2>/dev/null || +xclip -out -selection clipboard 2>/dev/null || notify-send "Selection and clipboard is empty" diff --git a/.local/bin/svlogtail b/.local/bin/svlogtail new file mode 100755 index 0000000..1dda671 --- /dev/null +++ b/.local/bin/svlogtail @@ -0,0 +1,55 @@ +#!/bin/sh +# From socklog-void +# https://github.com/void-linux/socklog-void/blob/master/svlogtail + +usage () { + cat <<-'EOF' + svlogtail [-f] [LOG...] - show svlogd logs conveniently + + Without arguments, show current logs of all services, uniquely. + With arguments, show all logs of mentioned services + + With -f, follow log output. + EOF +} + +globexist() { + [ -f "$1" ] +} + +IFS=' +' + +fflag=false +if [ "$1" = -f ]; then + shift + fflag=true +fi + +if [ $# = 0 ]; then + cat /var/log/socklog/*/current | sort -u + if $fflag; then + tail -Fq -n0 /var/log/socklog/*/current | uniq + fi +else + old= + cur= + for log; do + case "$log" in + -*) usage; exit 1;; + esac + if [ -d /var/log/socklog/$log ]; then + if globexist /var/log/socklog/$log/*.[us]; then + old="$old$IFS/var/log/socklog/$log/*.[us]" + fi + cur="$cur$IFS/var/log/socklog/$log/current" + else + echo "no logs for $log" 1>&2 + exit 1 + fi + done + cat $old $cur | sort + if $fflag; then + tail -Fq -n0 $cur + fi +fi diff --git a/gtkrc-2.0 b/gtkrc-2.0 deleted file mode 100644 index 73dbc57..0000000 --- a/gtkrc-2.0 +++ /dev/null @@ -1,19 +0,0 @@ -# DO NOT EDIT! This file will be overwritten by LXAppearance. -# Any customization should be done in ~/.gtkrc-2.0.mine instead. - -include "/home/master/.gtkrc-2.0.mine" -gtk-theme-name="Arc-Dark" -gtk-icon-theme-name="Gruvbox-Plus-Dark" -gtk-font-name="Fira Sans 14" -gtk-cursor-theme-size=24 -gtk-toolbar-style=GTK_TOOLBAR_ICONS -gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR -gtk-button-images=1 -gtk-menu-images=1 -gtk-enable-event-sounds=1 -gtk-enable-input-feedback-sounds=1 -gtk-xft-antialias=1 -gtk-xft-hinting=1 -gtk-xft-hintstyle="hintmedium" -gtk-xft-rgba="none" -gtk-modules="canberra-gtk-module:gail:atk-bridge" |