diff options
author | Vikas Kushwaha <dev@vikas.rocks> | 2025-06-01 20:48:49 +0530 |
---|---|---|
committer | Vikas Kushwaha <dev@vikas.rocks> | 2025-06-01 20:48:49 +0530 |
commit | 132ec769505533c24bd06f6604913fdc1db6fe35 (patch) | |
tree | c21a0f93fad8f12b3901ea21a2024a9df2e1622b | |
parent | 0d397e4d3d204a1e016c0863815f0b5dc516c46b (diff) |
git updates
31 files changed, 212 insertions, 215 deletions
diff --git a/.config/X11/Xresources b/.config/X11/Xresources index fcc61aa..e03daba 100644 --- a/.config/X11/Xresources +++ b/.config/X11/Xresources @@ -1,5 +1,5 @@ -Xcursor.size: 40 -Xcursor.theme: Banana +Xcursor.theme: elementary +Xcursor.size: 32 !! Transparency (0-1): st.alpha: 0.95 diff --git a/.config/X11/xprofile b/.config/X11/xprofile index 240aa8d..dec8036 100644 --- a/.config/X11/xprofile +++ b/.config/X11/xprofile @@ -4,10 +4,13 @@ xrdb "${XDG_CONFIG_HOME:-$HOME/.config}/X11/Xresources" & xrdbpid=$! numlockx on & +setdp +setbg logdir="${XDG_STATE_HOME:-$HOME/.local/state}/startup" -autostart="copyq dunst pipewire syncthing remapd gammastep setdp prime-offload mailsyncd" +autostart="copyq dunst pipewire syncthing remapd gammastep prime-offload picom mailsyncd" +sleep 1 mkdir -pv "$logdir" for program in $autostart; do pidof -sx "$program" || "$program" >"$logdir/$program.stdout.log" 2>"$logdir/$program.stderr.log" & diff --git a/.config/gtk-2.0/gtkrc-2.0 b/.config/gtk-2.0/gtkrc-2.0 index 73dbc57..3b9adea 100644 --- a/.config/gtk-2.0/gtkrc-2.0 +++ b/.config/gtk-2.0/gtkrc-2.0 @@ -4,9 +4,8 @@ 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-font-name="Fira Sans 16" +gtk-toolbar-style=GTK_TOOLBAR_BOTH gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR gtk-button-images=1 gtk-menu-images=1 @@ -16,4 +15,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/gtk-2.0/gtkrc-2.0.bak b/.config/gtk-2.0/gtkrc-2.0.bak deleted file mode 100644 index c8d0af9..0000000 --- a/.config/gtk-2.0/gtkrc-2.0.bak +++ /dev/null @@ -1,20 +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-Material-Dark" -gtk-font-name="Fira Sans 14" -gtk-cursor-theme-name="Qogir-dark" -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="hintfull" -gtk-xft-rgba="none" -gtk-modules="canberra-gtk-module:gail:atk-bridge" diff --git a/.config/gtk-3.0/settings.ini b/.config/gtk-3.0/settings.ini index ce89467..d02b49f 100644 --- a/.config/gtk-3.0/settings.ini +++ b/.config/gtk-3.0/settings.ini @@ -8,8 +8,8 @@ gtk-font-name=Fira Sans 16 gtk-menu-images=1 gtk-button-images=1 gtk-toolbar-style=GTK_TOOLBAR_BOTH -gtk-cursor-theme-name=Banana -gtk-cursor-theme-size=40 +gtk-cursor-theme-name=elementary +gtk-cursor-theme-size=32 gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR gtk-enable-event-sounds=1 gtk-enable-input-feedback-sounds=1 diff --git a/.config/i3/config b/.config/i3/config index 23697c5..2c12947 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -101,6 +101,7 @@ bindsym Ctrl+Print exec --no-startup-id $preferredScreenCaptureTool bindsym $super+Return exec --no-startup-id $preferredTerminalEmulator bindsym $super+t exec --no-startup-id xfce4-terminal +bindsym $super+Shift+t exec --no-startup-id notify-send Temprature "$(sensors --no-adapter coretemp-isa-0000 | tail +2 | sed "s|(.*)||")" font pango: source code pro 16 @@ -194,6 +195,7 @@ bindsym $super+Shift+Print --release exec --no-startup-id i3-scrot -s # kill focused window bindsym $super+q kill +bindsym $super+Shift+q exec xkill -id "$(xdotool getactivewindow)" # split in horizontal orientation # bindsym $super+apostrophe split h @@ -406,7 +408,6 @@ workspace $ws7 output "HDMI-0" workspace $ws8 output "HDMI-0" workspace $ws9 output "HDMI-0" workspace $ws10 output "HDMI-0" -workspace "12: W " output "HDMI-0" #################### @@ -546,7 +547,7 @@ bar { bar { output nonprimary - status_command exec i3blocks -c ~/.config/i3blocks/systeminfo + status_command exec i3blocks -c ~/.config/i3blocks/bar2 bindsym --release button3 exec jgmenu --at-pointer workspace_min_width 40 strip_workspace_numbers yes diff --git a/.config/i3blocks/systeminfo b/.config/i3blocks/bar2 index d4428a1..3bcfe48 100644 --- a/.config/i3blocks/systeminfo +++ b/.config/i3blocks/bar2 @@ -25,6 +25,14 @@ separator=false separator_block_width=60 +# Guess the weather hourly +[weather] +separator=true +separator_block_width=50 +command=i3weather 2 +interval=1800 +color=#A4C2F4 + # [badwidth] # seprator=false # command=echo "$(i3bandwidth)" diff --git a/.config/i3blocks/config b/.config/i3blocks/config index 638f638..96f2448 100644 --- a/.config/i3blocks/config +++ b/.config/i3blocks/config @@ -29,7 +29,7 @@ separator_block_width=35 [weather] separator=true separator_block_width=50 -command=i3weather +command=i3weather 1 interval=1800 color=#A4C2F4 @@ -58,13 +58,19 @@ command=echo " $(i3memory)" interval=1 [datetime] -separator=false -separator_block_width=25 +separator=true # command=case "$BLOCK_BUTTON" in 1) TERM=256colors clearx -n 'cal -y --color=always | less' ;; 2) $TERMINAL -e nvim ~/.config/i3blocks/config ;; esac; date +'🕒 %H:%M:%S 🗓️ %a %d.%m.%Y ' -command=case "$BLOCK_BUTTON" in 1) $TERMINAL -e sh -c 'cal -y --color=always | less' ;; 2) $TERMINAL -e nvim ~/.config/i3blocks/config ;; esac; date +' %H:%M:%S %a %d.%m.%Y ' -color=#CCFFFF +command=case "$BLOCK_BUTTON" in 1) $TERMINAL -e sh -c 'cal -y --color=always | less' ;; 2) $TERMINAL -e nvim ~/.config/i3blocks/config ;; esac; date +' %H:%M:%S %a %d.%m.%Y ✝ ' +color=#BBDDDD interval=1 +# [cross] +# separator=true +# separator_block_width=25 +# command=echo "☦" +# color=#CCFFFF +# interval=once + # [ip] # command=hostname -i # | awk '{ print "IP:" $1 }' # interval=once diff --git a/.config/lf/lfrc b/.config/lf/lfrc index c0bf283..d2937e6 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -117,8 +117,8 @@ map <c-k> ${{ lf -remote "send $id cd \"$(cat ${CD_HISTFILE:-${XDG_STATE_HOME:-$ fzf --reverse --tac --header-first --header='Path History')\"" }} map <c-c> select_eval "fzf --reverse --track --header-first --header='Jump to location' --query \"^${f##*/}/$\" --bind 'load:change-query(/$ )'" -map c map d +map c push :$mk<space>""<c-b> map I :rename; cmd-home map i :rename; cmd-word-back; cmd-left map a :rename; cmd-right @@ -128,12 +128,12 @@ map o $LESSOPEN="|preview %s" less -r $f map O $mimeopen --ask $f map . set hidden! map x cut -map M $lf -remote "send $id select \"$(FZF_DEFAULT_OPTS="--track --query '^${f##*/}$' --bind 'load:clear-query'" fmd)\"" +map M $lf -remote "send $id select \"$(FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS --track --query '^${f##*/}$' --bind 'load:clear-query'" fmd)\"" map D delete map W $setsid -f $TERMINAL >/dev/null 2>&1 map X !$f -map C push :$mk<space>""<c-b> map b $vidir +map B $find . | vidir - map V push :!nvim<space>""<c-b> map P :link diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index eeedeae..67eb5b8 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -32,7 +32,7 @@ if filereadable(config_dir . "autoload/plug.vim") call plug#end() endif -packadd fzf.vim +packadd! fzf.vim source ~/.config/nvim/user/fzf.vim set rtp+=/usr/share/vim/vimfiles @@ -58,7 +58,6 @@ highlight ColorColumn ctermbg=238 highlight! link CursorColumn ColorColumn highlight FloatermBorder guibg=orange guifg=cyan autocmd FileType text,fstab setlocal tabstop=8 shiftwidth=8 -autocmd FileType html setlocal tabstop=2 shiftwidth=2 list nolinebreak autocmd FileType sql setlocal commentstring=--\ %s autocmd BufWritePre * %s/\s\+$//e autocmd BufEnter bm-files,bm-dirs setlocal tabstop=8 shiftwidth=8 @@ -123,7 +122,10 @@ endfunction autocmd BufNewFile * call SourceTemplate() autocmd TermOpen * startinsert -command! -nargs=* T split | terminal <args> +command! -nargs=* TermSplit split | terminal <args> +command! -nargs=* TermVSplit vsplit | terminal <args> + +command! -nargs=* T tabnew <args> " --> Bindings and configs @@ -147,7 +149,7 @@ vnoremap <C-A-c> "*d :let @+=@*<CR> noremap <C-p> "+p noremap <C-A-p> "+P -nnoremap c "_c +nnoremap c "cc inoremap jk <Esc> " map ;n /<++><Enter>c4l inoremap ;n <Esc>/<++><Enter>c4l @@ -155,8 +157,9 @@ nnoremap <leader>n /<++><Enter>c4l augroup Web autocmd! - autocmd FileType html,javascript call SetWebBindings() - function SetWebBindings() + autocmd FileType html,javascript call SetWebOptions() + function SetWebOptions() + setlocal tabstop=2 shiftwidth=2 list nolinebreak inoremap ;s ><Esc>bi<<Esc>ea inoremap ;c ><Esc>bi</<Esc>ea inoremap ;i <Esc>b"tywi<<Esc>ea></><Esc>PF<i @@ -173,8 +176,8 @@ augroup END augroup Tex autocmd! - autocmd FileType tex call SetTexBindings() - function SetTexBindings() + autocmd FileType tex call SetTexOptions() + function SetTexOptions() inoremap ;b <Esc>b"tywi\begin{<Esc>ea}<CR>\end{<Esc>"tpa}<Esc>kA inoremap ;s \section{}<Esc>i inoremap ;at \begin{tikzpicture}<CR>\end{tikzpicture}<Esc>O @@ -197,25 +200,25 @@ nnoremap <leader>ft :w<CR>:!dev test "%"<CR> nnoremap <leader>fb :w<CR>:!dev build "%"<CR> nnoremap <leader>fr :w<CR>:!dev clean "%"<CR> -nnoremap <leader>Fl :w<CR>:T dev lint "%"<CR> -nnoremap <leader>Fm :w<CR>:T dev format "%"<CR> -nnoremap <leader>Fc :w<CR>:T dev compile "%"<CR> -nnoremap <leader>Fe :w<CR>:T dev run "%"<CR> -nnoremap <leader>Ft :w<CR>:T dev test "%"<CR> -nnoremap <leader>Fr :w<CR>:T dev clean "%"<CR> +nnoremap <leader>Fl :w<CR>:TermSplit dev lint "%"<CR> +nnoremap <leader>Fm :w<CR>:TermSplit dev format "%"<CR> +nnoremap <leader>Fc :w<CR>:TermSplit dev compile "%"<CR> +nnoremap <leader>Fe :w<CR>:TermSplit dev run "%"<CR> +nnoremap <leader>Ft :w<CR>:TermSplit dev test "%"<CR> +nnoremap <leader>Fr :w<CR>:TermSplit dev clean "%"<CR> nnoremap <leader>b :w<CR>:se nornu<CR>:!dev build "%"<CR>:se rnu<CR> -nnoremap <leader>B :w<CR>:se nornu<CR>:T dev build "%"<CR> +nnoremap <leader>B :w<CR>:se nornu<CR>:TermSplit dev build "%"<CR> nnoremap <leader>t :w<CR>:se nornu<CR>:!dev test "%"<CR>:se rnu<CR> -nnoremap <leader>T :w<CR>:se nornu<CR>:T dev test "%"<CR> +nnoremap <leader>T :w<CR>:se nornu<CR>:TermSplit dev test "%"<CR> nnoremap <leader>w :set wrap!<CR> nnoremap <leader>fo :!opout "%:p"<CR> nnoremap <leader><C-r> :source ~/.config/nvim/init.vim<CR> nnoremap <leader>s :%s//gc<Left><Left><Left> -nnoremap <leader>gc :T git add --all && git commit<CR> -nnoremap <leader>gp :T gitpush<CR> +nnoremap <leader>gc :TermSplit git add --all && git commit<CR> +nnoremap <leader>gp :TermSplit gitpush<CR> let shortcuts = config_dir . "shortcuts.vim" if filereadable(shortcuts) diff --git a/.config/picom.conf b/.config/picom.conf index b3c84bd..ae5a4b3 100644 --- a/.config/picom.conf +++ b/.config/picom.conf @@ -110,8 +110,8 @@ shadow-ignore-shaped = false; # ################################# -inactive-opacity = 0.90; -active-opacity = 0.95; +inactive-opacity = 0.95; +active-opacity = 0.97; frame-opacity = 1; inactive-opacity-override = false; diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index 5c9826a..06b59da 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -10,8 +10,8 @@ alias l='ls -A' alias ll='ls -al' alias lr='ls -aR' # open -alias o='${OPENER:-xdg-open}' -alias e='${EDITOR:-vi}' +alias o="${OPENER:-xdg-open}" +alias e="${EDITOR:-vi}" alias se='sudoedit' alias lf='lfcd' alias sr='ff ~/.config ~/.local/bin ~/bin' @@ -26,11 +26,11 @@ ff() { find -H "$@" ! -wholename '*.git*' ! \( -type d -printf '%p/\n' , ! -type senv() { source "${XDG_DATA_HOME:-$HOME/.local/share}/virtualenvs/${1:-main}/bin/activate"; } sudoedit() { - if command -V vim >/dev/null; then + if command -V nvim >/dev/null; then + sudo nvim -u "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/init.vim" "$@" + elif command -V vim >/dev/null; then [ -f "$HOME/.vim/vimrc" ] && VIMRC="$HOME/.vim/vimrc" sudo vim -u "${VIMRC:-$HOME/.vimrc}" "$@" - elif command -V nvim >/dev/null; then - sudo nvim -u "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/init.vim" "$@" else command sudoedit "$@" fi @@ -83,3 +83,4 @@ alias grep='grep --color=auto' alias tree='tree -C --dirsfirst' alias ls='ls -h --group-directories-first --color=auto --classify=auto' alias info='info --vi-keys --init-file ~/.config/infokey' +alias rsync='rsync -h' diff --git a/.config/shell/bm-dirs b/.config/shell/bm-dirs index b729ac5..25eb1ea 100644 --- a/.config/shell/bm-dirs +++ b/.config/shell/bm-dirs @@ -1,7 +1,7 @@ # You can add comments to these files with # cac ${XDG_CACHE_HOME:-$HOME/.cache} cg ${XDG_CONFIG_HOME:-$HOME/.config} -lbn ${XDG_SCRIPTS_DIR:-$HOME/.local/bin} +lb ${XDG_SCRIPTS_DIR:-$HOME/.local/bin} lsh ${XDG_DATA_DIR:-$HOME/.local/share} lst ${XDG_STATE_DIR:-$HOME/.local/state} lsr ${XDG_SOURCE_DIR:-$HOME/.local/src} @@ -12,7 +12,7 @@ px ${XDG_PICTURES_DIR:-$HOME/Pictures} vd ${XDG_VIDEOS_DIR:-$HOME/Videos} nv ${XDG_CONFIG_HOME:-$HOME/.config}/nvim -lsha ${XDG_DATA_DIR:-$HOME/.local/share}/applications +lsa ${XDG_DATA_DIR:-$HOME/.local/share}/applications vnv ${XDG_DATA_DIR:-$HOME/.local/share}/virtualenvs ltr ${XDG_DATA_DIR:-$HOME/.local/share}/Trash dl ${XDG_DOCUMENTS_DIR:-$HOME/Documents}/latex @@ -36,16 +36,16 @@ sv ~/Phone/.stversions pw ~/Phone/Android/media/com.whatsapp.w4b/WhatsApp\ Business/Media/WhatsApp\ Business\ Documents mn /mnt -stg ${STORAGE:-/mnt/storage} -lbr ${STORAGE:-/mnt/storage}/Library -med ${STORAGE:-/mnt/storage}/Media -sts ${STORAGE:-/mnt/storage}/sites +sg ${STORAGE:-/mnt/storage} +lr ${STORAGE:-/mnt/storage}/Library +md ${STORAGE:-/mnt/storage}/Media +st ${STORAGE:-/mnt/storage}/sites sd /sdcard mp /run/media/$USER/ mtp /run/user/1000/gvfs usr ${PREFIX:-/usr} ush /usr/share usd /usr/share/doc -usha /usr/share/applications +usa /usr/share/applications tmp /tmp -tmu /tmp/mozilla_${USER}0 +mzt /tmp/mozilla_${USER}0 diff --git a/.config/shell/bm-files b/.config/shell/bm-files index 8685e00..2585175 100644 --- a/.config/shell/bm-files +++ b/.config/shell/bm-files @@ -4,21 +4,21 @@ bf ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-files bd ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs -cpf ~/.profile -czp ~/.zprofile -cxp ~/.xprofile -cgi ~/.gitignore -czr ${XDG_CONFIG_HOME:-$HOME/.config}/zsh/.zshrc -car ${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc -clc ${XDG_CONFIG_HOME:-$HOME/.config}/lf/lfrc -csx ${XDG_CONFIG_HOME:-$HOME/.config}/sxiv/exec/key-handler -cin ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/init.vim -cac ${XDG_CONFIG_HOME:-$HOME/.config}/alacritty/alacritty.toml -cxr ${XDG_CONFIG_HOME:-$HOME/.config}/X11/Xresources -cxi ${XDG_CONFIG_HOME:-$HOME/.config}/X11/xinitrc -cml ${XDG_CONFIG_HOME:-$HOME/.config}/mimeapps.list -cfi ${XDG_CONFIG_HOME:-$HOME/.config}/fd/ignore -csc ~/.ssh/config +pf ~/.profile +zp ~/.zprofile +xp ~/.xprofile +gi ~/.gitignore +zr ${XDG_CONFIG_HOME:-$HOME/.config}/zsh/.zshrc +ar ${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc +lf ${XDG_CONFIG_HOME:-$HOME/.config}/lf/lfrc +sx ${XDG_CONFIG_HOME:-$HOME/.config}/sxiv/exec/key-handler +in ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/init.vim +ac ${XDG_CONFIG_HOME:-$HOME/.config}/alacritty/alacritty.toml +xr ${XDG_CONFIG_HOME:-$HOME/.config}/X11/Xresources +xi ${XDG_CONFIG_HOME:-$HOME/.config}/X11/xinitrc +ml ${XDG_CONFIG_HOME:-$HOME/.config}/mimeapps.list +fi ${XDG_CONFIG_HOME:-$HOME/.config}/fd/ignore +sc ~/.ssh/config zh ${XDG_STATE_HOME:-$HOME/.local/state}/zsh/history qn ${XDG_DOCUMENTS_HOME:-$HOME/Documents}/Notes/QuickNote.md diff --git a/.config/yt-dlp/channel.conf b/.config/yt-dlp/channel.conf index c742d18..e67e86c 100644 --- a/.config/yt-dlp/channel.conf +++ b/.config/yt-dlp/channel.conf @@ -8,5 +8,6 @@ # --playlist-items ::-1 --write-thumbnail +--embed-thumbnail --write-playlist-metafiles --download-archive .info/archive.txt diff --git a/.config/yt-dlp/config b/.config/yt-dlp/config index 3c9c2e1..20f6aad 100644 --- a/.config/yt-dlp/config +++ b/.config/yt-dlp/config @@ -9,6 +9,5 @@ --convert-subs srt --embed-subs ---write-description --embed-metadata --embed-chapters diff --git a/.config/yt-dlp/playlist.conf b/.config/yt-dlp/playlist.conf index 26adc67..74af4dd 100644 --- a/.config/yt-dlp/playlist.conf +++ b/.config/yt-dlp/playlist.conf @@ -8,5 +8,6 @@ --playlist-items ::-1 --write-thumbnail +--embed-thumbnail --write-playlist-metafiles --download-archive archive.txt diff --git a/.config/yt-dlp/videos.conf b/.config/yt-dlp/videos.conf index c9e8013..42d9c40 100644 --- a/.config/yt-dlp/videos.conf +++ b/.config/yt-dlp/videos.conf @@ -1,2 +1,3 @@ --config config --format bestvideo*[height<=1080][fps<=60]+bestaudio +--write-description diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 93c6e01..824252b 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -52,7 +52,7 @@ preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt. # Completion. autoload -Uz compinit compinit -d ~/.cache/zshcompdump-$ZSH_VERSION -zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' # Case insensitive tab completion +zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' # Case insensitive tab completion zstyle ':completion:*' rehash true # automatically find new executables in path zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" # Colored completion (different colors for dirs/files/etc) zstyle ':completion:*' completer _expand _complete _ignored _approximate diff --git a/.local/bin/desktop/setbg b/.local/bin/desktop/setbg index c288895..8277caf 100755 --- a/.local/bin/desktop/setbg +++ b/.local/bin/desktop/setbg @@ -36,6 +36,6 @@ else [ -f "$zathuraconf.bak" ] && unlink "$zathuraconf" && mv "$zathuraconf.bak" "$zathuraconf" fi -xwallpaper --zoom "$bgloc" +xwallpaper --focus "$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/development/gh-clone-all b/.local/bin/development/gh-clone-all index d2b3cdc..fed6efe 100755 --- a/.local/bin/development/gh-clone-all +++ b/.local/bin/development/gh-clone-all @@ -12,5 +12,5 @@ while [ "$page" -lt "$max" ]; do page=$(( page + 1 )) curl "https://api.github.com/$cntx/$name/repos?page=$page&per_page=100" | sed -E '/^\s*"clone_url": "(.*)",$/!d; s//\1/' | - xargs -L1 echo git clone + xargs -L1 git clone done diff --git a/.local/bin/development/github-repo-size b/.local/bin/development/gh-repo-size index 0cedd88..0cedd88 100755 --- a/.local/bin/development/github-repo-size +++ b/.local/bin/development/gh-repo-size diff --git a/.local/bin/development/ghclone b/.local/bin/development/ghclone new file mode 100755 index 0000000..2e11024 --- /dev/null +++ b/.local/bin/development/ghclone @@ -0,0 +1,5 @@ +#!/bin/sh + +URL="https://github.com/$1/${2:-$1}" +echo "Clone URL: $URL" +git clone "$URL" diff --git a/.local/bin/shorts/gi b/.local/bin/development/gitignore index d78ff99..d78ff99 100755 --- a/.local/bin/shorts/gi +++ b/.local/bin/development/gitignore diff --git a/.local/bin/development/gitw b/.local/bin/development/gitweb index 881c81c..881c81c 100755 --- a/.local/bin/development/gitw +++ b/.local/bin/development/gitweb diff --git a/.local/bin/fgr b/.local/bin/fgr new file mode 100755 index 0000000..34d69cc --- /dev/null +++ b/.local/bin/fgr @@ -0,0 +1,82 @@ +#!/bin/sh + +# https://junegunn.github.io/fzf/tips/ripgrep-integration/#6-bind-enter-to-become-action + +help() { echo "fgr - grep with fzf (fzf-grep) + +USAGE: + fgr [OPTION]... PATTERN + +OPTIONS: + -r real time grepping with fzf prompt + -h show this help message + +ENVIRONMENT VARIABLES: + FZF_GREP_COMMAND overrides the default grep command whose content is piped into fzf + FZF_GREP_OPENER overrides the default opener used to open selection on pressing 'enter' + "; } + +err() { printf '%s: %s\n' "$0" "$@" >&2; exit 1; } + +while getopts 'rh' o; do case "$o" in + r) rflag=1 ;; + h) help >&2; exit ;; + ?) err "invalid option passed" ;; +esac done +shift $((OPTIND - 1)) + +[ -z "$FZF_HISTDIR" ] && + export FZF_HISTDIR="${XDG_STATE_HOME:-$HOME/.local/state}/fzf" + +mkdir -pv "$FZF_HISTDIR" +export FZF_HIST="$FZF_HISTDIR/grep_history" + +[ -z "$FZF_GREP_COMMAND" ] && + if command -v rg >/dev/null; then + FZF_GREP_COMMAND="rg --smart-case --column --color=always" + elif command -v git >/dev/null; then + FZF_GREP_COMMAND="git grep -I --ignore-case --column --color=always" + else + FZF_GREP_COMMAND="grep -Rnsi --exclude-dir=.git --color=always" + fi + +[ -z "$FZF_GREP_RELOAD" ] && + FZF_GREP_RELOAD="reload($FZF_GREP_COMMAND {q} || :)" + +[ -z "$FZF_GREP_OPENER" ] && FZF_GREP_OPENER=' + if [[ $FZF_SELECT_COUNT -eq 0 ]]; then + $EDITOR {1} +{2} # No selection. Open the current line in Vim. + else + $EDITOR +cw -q {+f} # Build quickfix list for the selected items. + fi + ' + +FZF_OPENER=" + # update history + sed -i '\\|^{q}$|d' \"$FZF_HIST\" + echo {q} >> \"$FZF_HIST\" + + $FZF_GREP_OPENER + " + +query="$*" + +fzf() { $FZF_GREP_COMMAND "$query" | command fzf "$@" \ + --ansi --multi --exit-0 --header-first \ + --history="$FZF_HIST" \ + --bind "enter:execute($FZF_OPENER)" \ + --bind "ctrl-o:become($FZF_OPENER)" \ + --bind 'ctrl-v:toggle-preview,ctrl-space:toggle-preview' \ + --bind "ctrl-r:reload($FZF_GREP_COMMAND '$query')" \ + --bind 'alt-a:select-all,alt-d:deselect-all,ctrl-/:toggle-preview' \ + --delimiter : \ + --preview 'bat --style=full --color=always --highlight-line {2} {1}' \ + --preview-window '~4,+{2}+4/3,<80(up)'; } + +if [ "$rflag" = 1 ]; then + fzf --disabled --query "$query" \ + --header "COMMAND: $FZF_GREP_COMMAND <prompt-query>" \ + --bind "change:$FZF_GREP_RELOAD" +else + fzf --header "COMMAND: $FZF_GREP_COMMAND '$query'" +fi diff --git a/.local/bin/frg b/.local/bin/frg deleted file mode 100755 index 97f703a..0000000 --- a/.local/bin/frg +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -# https://junegunn.github.io/fzf/tips/ripgrep-integration/#6-bind-enter-to-become-action - -help() { echo "frg - grep with fzf - -USAGE: - fgrp [OPTION]... PATTERN - -OPTIONS: - -r real time grepping in fzf prompt - -h show this help message"; } - -err() { printf '%s: %s\n' "$0" "$@" >&2; exit 1; } - -while getopts 'rh' o; do case "$o" in - r) rflag=1 ;; - h) help >&2; exit ;; - ?) err "invalid option passed" ;; -esac done -shift $((OPTIND - 1)) - -[ -z "$FZF_HISTDIR" ] && - export FZF_HISTDIR="${XDG_STATE_HOME:-$HOME/.local/state}/fzf" -mkdir -pv "$FZF_HISTDIR" -export FZF_HIST="$FZF_HISTDIR/grep_history" - -if command -v rg >/dev/null; then - GREP_CMD="rg --smart-case --column --color=always" -elif command -v git >/dev/null; then - GREP_CMD="git grep -I --ignore-case --column --color=always" -else - GREP_CMD="grep -Rnsi --exclude-dir=.git --color=always" -fi - -RELOAD="reload($GREP_CMD {q} || :)" - -OPENER=' - # update history - sed -i \\\|^{q}$\|d "$FZF_HIST" - echo {q} >> "$FZF_HIST" - - if [[ $FZF_SELECT_COUNT -eq 0 ]]; then - $EDITOR {1} +{2} # No selection. Open the current line in Vim. - else - $EDITOR +cw -q {+f} # Build quickfix list for the selected items. - fi - ' - -query="$*" - -fzf() { $GREP_CMD "$query" | command fzf "$@" \ - --ansi --multi --header-first \ - --history="$FZF_HIST" \ - --bind "enter:execute($OPENER)" \ - --bind "ctrl-o:become($OPENER)" \ - --bind 'ctrl-v:toggle-preview,ctrl-space:toggle-preview' \ - --bind "ctrl-r:reload($GREP_CMD '$query')" \ - --bind 'alt-a:select-all,alt-d:deselect-all,ctrl-/:toggle-preview' \ - --delimiter : \ - --preview 'bat --style=full --color=always --highlight-line {2} {1}' \ - --preview-window '~4,+{2}+4/3,<80(up)'; } - -if [ "$rflag" = 1 ]; then - fzf --disabled --query "$query" \ - --header "COMMAND: $GREP_CMD <prompt-query>" \ - --bind "change:$RELOAD" -else - fzf --header "COMMAND: $GREP_CMD '$query'" -fi diff --git a/.local/bin/shortcuts b/.local/bin/shortcuts index af3fe5b..91790e6 100755 --- a/.local/bin/shortcuts +++ b/.local/bin/shortcuts @@ -17,12 +17,13 @@ eval "echo \"$(cat "$bmdirs")\"" | awk -F'\t' " !/^\s*#/ && !/^\s*$/ { gsub(\"\\\s*#.*$\", \"\"); - printf(\"c%s='cd %s && ls -A' \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" - printf(\"d%s=\42%s\42 \\\\\n\", \$1, \$2) >> \"$shell_env_shortcuts\" - printf(\"hash -d d%s=%s\n\", \$1, \$2) >> \"$zsh_named_dirs\" - printf(\"map c%s :cd %s\n\", \$1, \$2) >> \"$lf_shortcuts\" - printf(\"cmap ;d%s %s\n\", \$1, \$2) >> \"$vim_shortcuts\" - printf(\"imap ;d%s %s\n\", \$1, \$2) >> \"$vim_shortcuts\" + printf(\"C%s='cd %s && ls -A' \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" + printf(\"D%s='cd %s && ls -A' \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" + printf(\"D%s=\42%s\42 \\\\\n\", \$1, \$2) >> \"$shell_env_shortcuts\" + printf(\"hash -d D%s=%s\n\", \$1, \$2) >> \"$zsh_named_dirs\" + printf(\"map C%s :cd %s\n\", \$1, \$2) >> \"$lf_shortcuts\" + printf(\"cmap ;D%s %s\n\", \$1, \$2) >> \"$vim_shortcuts\" + printf(\"imap ;D%s %s\n\", \$1, \$2) >> \"$vim_shortcuts\" } " @@ -30,11 +31,12 @@ eval "echo \"$(cat "$bmfiles")\"" | awk -F'\t' " !/^\s*#/ && !/^\s*$/ { gsub(\"\\\s*#.*$\", \"\"); - printf(\"e%s='\$EDITOR %s' \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" - printf(\"export f%s=\42%s\42 \\\\\n\", \$1, \$2) >> \"$shell_env_shortcuts\" - printf(\"hash -d f%s=%s\n\", \$1, \$2) >> \"$zsh_named_dirs\" + printf(\"E%s='\$EDITOR %s' \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" + printf(\"F%s='\$EDITOR %s' \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" + printf(\"F%s=\42%s\42 \\\\\n\", \$1, \$2) >> \"$shell_env_shortcuts\" + printf(\"hash -d F%s=%s\n\", \$1, \$2) >> \"$zsh_named_dirs\" printf(\"map E%s $\$EDITOR %s\n\", \$1, \$2) >> \"$lf_shortcuts\" - printf(\"cmap ;f%s %s\n\", \$1, \$2) >> \"$vim_shortcuts\" - printf(\"imap ;f%s %s\n\", \$1, \$2) >> \"$vim_shortcuts\" + printf(\"cmap ;F%s %s\n\", \$1, \$2) >> \"$vim_shortcuts\" + printf(\"imap ;F%s %s\n\", \$1, \$2) >> \"$vim_shortcuts\" } " diff --git a/.local/bin/shorts/mailsyncd b/.local/bin/shorts/mailsyncd index 4b51c45..fdc132f 100755 --- a/.local/bin/shorts/mailsyncd +++ b/.local/bin/shorts/mailsyncd @@ -2,5 +2,5 @@ while true; do mailsync - sleep 5m + sleep 10m done diff --git a/.local/bin/statusbar/i3weather b/.local/bin/statusbar/i3weather index d008deb..c894be6 100755 --- a/.local/bin/statusbar/i3weather +++ b/.local/bin/statusbar/i3weather @@ -2,20 +2,30 @@ # weather module for i3blocks # output is set to 'WEATHER UNAVAILABLE' in case wttr.in is unreachable +WTTR_CACHE_DIR="/tmp" +WTTR_CACHE="$WTTR_CACHE_DIR/wttr.in" +WTTR_TXT="$WTTR_CACHE_DIR/wttr.txt" +WTTR_LOCATION="Vasai" +WTTR_URL="https://wttr.in/$WTTR_LOCATION" + case "$BLOCK_BUTTON" in - '') ;; + '') true ;; 1) - $TERMINAL -e less -r ~/.cache/weather.txt & sleep 0.3 - i3-msg 'move to workspace "12: Weather"; workspace "12: Weather"' >/dev/null 2>&1 + [ -f "$WTTR_CACHE" ] || BLOCK_BUTTON=5 i3weather + sed 's,\x1B\[[0-9;]*[a-zA-z],,g' "$WTTR_CACHE" > "$WTTR_TXT" + st -c "dropdown_weather" \ + -g "$(wc -L < "$WTTR_TXT")x38" \ + -e less -r "$WTTR_CACHE" & sleep 0.3 ;; 2) $TERMINAL -e nvim "$0" ;; *) notify-send "⛅ Refreshing weather info..." ;; esac -HTTP_WEATHER="https://wttr.in/Vasai" -# weather="$(curl -s "$HTTP_WEATHER?format=%c%C++❄️+%t++☀️+%f++🌬️+%w")" -weather="$(curl -Ss "$HTTP_WEATHER?0&T&Q" | cut -c 16- | head -2 | - xargs echo "$(curl -s "$HTTP_WEATHER?format=%c")")" +case "$1" in + 1) weather="$(curl -s "$WTTR_URL?format=%c")$WTTR_LOCATION $(curl -Ss "$WTTR_URL?0&T&Q" | sed -E '2,3!d; s/.{16}(.{13}).*/\1/; s/ {4}$//' | tr -d '\n')" ;; + 2) weather="$(curl -s "$WTTR_URL?format=%c%C")" ;; + *) weather="$(curl -s "$WTTR_URL?format=%c") $(curl -Ss "$WTTR_URL?0&T&Q" | cut -c 16- | head -2)" ;; +esac if [ "$(echo "$weather" | grep -Ec "(Unknown|curl|HTML)")" -gt 0 ]; then echo "WEATHER UNAVAILABLE" @@ -23,5 +33,5 @@ else echo "${weather:-⛅ -- }" fi -curl -s "$HTTP_WEATHER" > ~/.cache/weather.txt +curl -s "$WTTR_URL" > "$WTTR_CACHE" diff --git a/.local/bin/web/ytplaylist b/.local/bin/web/ytplaylist deleted file mode 100755 index 7bc9026..0000000 --- a/.local/bin/web/ytplaylist +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -# Useful when creating a directory of videos sequenced as per a youtube -# playlist. -# Run this script from from the root of a directory that contains all the media -# and metadata files. -# The playlist file is expected to be in 'playlist' directory within the root -# with .pl.txt extension. (playlist/PLAYLIST_NAME.pl.txt) -# The new playlist directory will be created in the current directory i.e. the -# root if no other destination is passed as the second argument. - -case "$1" in - '') echo "ytplaylist - build a directory of sequenced videos using a playlist file\n -USAGE:\n\tytplaylist <PLAYLIST_FILE> [DESTINATION_DIR] " >&2; exit ;; - playlist/*.pl.txt) ;; - *) - printf "%s" "Unconventional file path, contniue? [y/N] " - read -r ans - case "$ans" in y) ;; *) exit 1 ;; esac - ;; -esac - -playlist="$(readlink -f $1)" -i=1 -fpl "$playlist" | while read -r file; do - if [ -z "$file" ]; then - i=$(( $i + 1 )) - continue - fi - dir="$(dirname "$file")" - base="$(basename "$file")" - rsync -Pru --mkpath "$file" \ - "${2:-$(basename "${playlist%.pl.txt}")}/${dir#$(readlink -f "$PWD")}/$(printf "%02d" "$i") $base" -done |