diff --git a/config/lf/lfrc b/config/lf/lfrc index b6d542fb..9d06c195 100644 --- a/config/lf/lfrc +++ b/config/lf/lfrc @@ -1,69 +1,85 @@ -# Basic Settings +# Yeet's lf settings + +# Basic vars + set previewer lf-ueberzug-previewer set cleaner lf-ueberzug-cleaner set preview true -set hidden true set drawbox true set icons true set ignorecase true -# Custom Functions +set shell zsh +set ifs "\n" +set scrolloff 10 +set period 1 +set hiddenfiles ".*:*.aux:*.log:*.bbl:*.bcf:*.blg:*.run.xml" + +# cmds/functions cmd open ${{ - echo "$fx" > /tmp/b - case $fx in - *.py|*.java|*.json|*.h|*.c|*.cpp|*.js) $EDITOR "$f";; - *.tar.bz|*.tar.bz2|*.tbz|*.tbz2|*.tar.gz|*.tgz|*.tar.xz|*.txz|*.zip|*.rar|*.iso) - mntdir="$f-archivemount" - echo $mntdir > /tmp/a - [ ! -d "$mntdir" ] && { - mkdir "$mntdir" - archivemount "$f" "$mntdir" - echo "$mntdir" >> "/tmp/__lf_archivemount_$id" - } - lf -remote "send $id cd \"$mntdir\"" - lf -remote "send $id reload" - ;; - *) - for f in $fx; do - $OPENER $f > /dev/null 2> /dev/null & - done;; + case $(file --mime-type $f -b) in + image/vnd.djvu|application/pdf|application/octet-stream) setsid -f zathura $fx >/dev/null 2>&1 ;; + text/*) $EDITOR $fx;; + image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;; + image/svg+xml) display -- $f ;; + image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|tif\|ico\)\(_large\)*$" | sxiv -aio 2>/dev/null | lf-select ;; + audio/*) mpv --audio-display=no $f ;; + video/*) setsid -f mpv $f -quiet >/dev/null 2>&1 ;; + application/pdf|application/vnd*|application/epub*) setsid -f zathura $fx >/dev/null 2>&1 ;; + *) for f in $fx; do setsid -f $OPENER $f >/dev/null 2>&1; done;; esac }} -cmd mkdir ${{ - printf "Directory Name: " - read ans - mkdir $ans - cd $and -}} +cmd mkdir $mkdir -p "$(echo $* | tr ' ' '\ ')" -cmd mkfile ${{ - printf "File Name: " - read ans - $EDITOR $ans +cmd extract ${{ + clear; tput cup $(($(tput lines)/3)); tput bold + set -f + printf "%s\n\t" "$fx" + printf "extract?[y/N]" + read ans + [ $ans = "y" ] && ext $fx }} -cmd chmod ${{ - printf "Mode Bits: " - read ans - - for file in "$fx" - do - chmod $ans $file - done +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 +}} - lf -remote 'send reload' +cmd moveto ${{ + clear; tput cup $(($(tput lines)/3)); tput bold + set -f + clear; echo "Move to where?" + dest="$(cut -d' ' -f2- ${XDG_CONFIG_HOME:-$HOME/.config}/zsh/bm-dirs | fzf | sed 's|~|$HOME|' )" && + for x in $fx; do + eval mv -iv \"$x\" \"$dest\" + done && + notify-send "File(s) moved." "File(s) moved to $dest." }} -cmd trash %trash-put $fx +cmd copyto ${{ + clear; tput cup $(($(tput lines)/3)); tput bold + set -f + clear; echo "Copy to where?" + dest="$(cut -d' ' -f2- ${XDG_CONFIG_HOME:-$HOME/.config}/zsh/bm-dirs | fzf | sed 's|~|$HOME|' )" && + for x in $fx; do + eval cp -ivr \"$x\" \"$dest\" + done && + notify-send " File(s) copied." "File(s) copies to $dest." +}} -cmd setwallpaper ${{ +cmd setbg ${{ echo "$fx" > /tmp/c echo convert "$fx" "$HOME/.local/backgrounds/wall.jpg" > /tmp/d convert "$fx" "$HOME/.local/backgrounds/wall.jpg" - feh --bg-fill "$HOME/.local/backgrounds/wall.jpg" + feh --no-fehbg --bg-fill "$HOME/.local/backgrounds/wall.jpg" }} + cmd git_branch ${{ git branch | fzf | xargs git checkout pwd_shell=$(pwd) @@ -71,22 +87,6 @@ cmd git_branch ${{ lf -remote "send $id cd \"$pwd_shell\"" }} -cmd fzf_jump ${{ - res="$(find . -maxdepth 3 | fzf --reverse --header='Jump to location')" - if [ -f "$res" ]; then - cmd="select" - elif [ -d "$res" ]; then - cmd="cd" - fi - lf -remote "send $id $cmd \"$res\"" -}} - -cmd cd_jump ${{ - printf "Keyword: " - read ans - lf -remote "send $id cd $ans" -}} - cmd on-cd &{{ # display git repository status in your prompt source /usr/share/git/completion/git-prompt.sh @@ -100,109 +100,40 @@ cmd on-cd &{{ lf -remote "send $id set promptfmt \"$fmt\"" }} -cmd open ${{ - case "$f" in - esac -}} - -# Archive bindings -cmd unarchive ${{ - case "$f" in - *.zip) unzip "$f" ;; - *.tar.gz) tar -xzvf "$f" ;; - *.tar.bz2) tar -xjvf "$f" ;; - *.tar) tar -xvf "$f" ;; - *) echo "Unsupported format" ;; - esac -}} - -cmd zip %zip -r "$f" "$f" -cmd tar %tar cvf "$f.tar" "$f" +cmd bulkrename $vidir cmd targz %tar cvzf "$f.tar.gz" "$f" -cmd tarbz2 %tar cjvf "$f.tar.bz2" "$f" - -# Trash cli bindings -cmd trash ${{ - files=$(printf "$fx" | tr '\n' ';') - while [ "$files" ]; do - file=${files%%;*} - - trash-put "$(basename "$file")" - if [ "$files" = "$file" ]; then - files='' - else - files="${files#*;}" - fi - done -}} - -cmd clear_trash %trash-empty -cmd trash %trash-put $fx -cmd restore_trash ${{ - trash-restore -}} - -cmd stripspace %stripspace "$f" - -# Old keybinds cleanup -map m -map o -map n -map "'" -map '"' -map d -map c -map e -map f - -# File Openers -map e $$EDITOR "$f" -map u xdg-open "$f" - -# Archive Mappings -map az zip -map at tar -map ag targz -map ab targz -map au unarchive - -# Trash Mappings -map tt trash -map tc clear_trash -map tr restore_trash - -map ss stripspace - -# Basic Functions -map . set hidden! +# Bindings +map $lf -remote "send $id select '$(fzf)'" +map gh +map gg top map D delete -map p paste -map dd cut -map y copy -map open -map mf mkfile -map md mkdir -map ch chmod -map bg setwallpaper -map o open_config -map br $vimv $fx -map r rename -map H top -map L bottom -map R reload -map C clear -map U unselect - -map cd cd_jump -map cf fzf_jump - -# Git Mappings -map gib :git_branch -map gip ${{clear; git pull --rebase || true; echo "press ENTER"; read ENTER}} -map gis ${{clear; git status; echo "press ENTER"; read ENTER}} -map gil ${{clear; git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit}} - +map E extract +map T targz +map C copyto +map M moveto +map push :mkdir +map reload +map set hidden! +map shell +map x $$f +map X !$f +map o &mimeopen $f +map O $mimeopen --ask $f + +map A rename # at the very end +map r push A # new rename +map I push A # at the very beginning +map i push A # before extention +map a push A # after extention +map B bulkrename +map b setbg + +map down +map up +map V push :!vim + +map cd push !cd # Movement map ~ cd ~ map g/ cd / @@ -211,3 +142,9 @@ map gd cd ~/.dotfiles map gc cd ~/.config map gs cd ~/.local/share/bin +# Git Mappings +map gib :git_branch +map gip ${{clear; git pull --rebase || true; echo "press ENTER"; read ENTER}} +map gis ${{clear; git status; echo "press ENTER"; read ENTER}} +map gil ${{clear; git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit}} + diff --git a/config/ncmpcpp/bindings b/config/ncmpcpp/bindings index aaef890e..8865f2d2 100644 --- a/config/ncmpcpp/bindings +++ b/config/ncmpcpp/bindings @@ -45,8 +45,6 @@ #def_key "end" # move_end # -#def_key "insert" -# select_item # #def_key "enter" # enter_directory @@ -467,3 +465,13 @@ def_key "f" seek_forward def_key "b" seek_backward +def_key "B" + select_item +def_key "insert" + select_item +def_key "shift-up" + select_item + scroll_up +def_key "shift-down" + select_item + scroll_down diff --git a/config/readline/.inputrc b/config/readline/.inputrc new file mode 100644 index 00000000..58d7b82e --- /dev/null +++ b/config/readline/.inputrc @@ -0,0 +1 @@ +set enable-keypad on diff --git a/config/zsh/aliases b/config/zsh/aliases index c353b3c3..3dc9966b 100755 --- a/config/zsh/aliases +++ b/config/zsh/aliases @@ -1,6 +1,6 @@ #!/usr/bin/zsh -alias feh="feh --scale-down --auto-zoom" +alias feh="feh --scale-down --auto-zoom --no-fehbg" alias cclear="$(which clear)" alias clear="clear && paleofetch" alias neofetch="neofetch --ascii ~/.config/neofetch/ascii.txt" diff --git a/config/zsh/bm-dirs b/config/zsh/bm-dirs new file mode 100644 index 00000000..5e698726 --- /dev/null +++ b/config/zsh/bm-dirs @@ -0,0 +1,5 @@ +~/Downloads +~/Pictures +~/Projects +~/Documents +~/Nextcloud diff --git a/config/zsh/fzf.zsh b/config/zsh/fzf.zsh index f0fac174..6a6067b9 100644 --- a/config/zsh/fzf.zsh +++ b/config/zsh/fzf.zsh @@ -1,13 +1,13 @@ # Setup fzf # --------- -if [[ ! "$PATH" == */home/yigit/.fzf/bin* ]]; then - export PATH="${PATH:+${PATH}:}/home/yigit/.fzf/bin" +if [[ ! "$PATH" == */home/yigit/.local/share/fzf/bin* ]]; then + export PATH="${PATH:+${PATH}:}/home/yigit/.local/share/fzf/bin" fi # Auto-completion # --------------- -[[ $- == *i* ]] && source "/home/yigit/.fzf/shell/completion.zsh" 2> /dev/null +[[ $- == *i* ]] && source "/home/yigit/.local/share/fzf/shell/completion.zsh" 2> /dev/null # Key bindings # ------------ -source "/home/yigit/.fzf/shell/key-bindings.zsh" +source "/home/yigit/.local/share/fzf/shell/key-bindings.zsh" diff --git a/install.sh b/install.sh index 2faacf2c..26fe72ec 100755 --- a/install.sh +++ b/install.sh @@ -18,6 +18,7 @@ fi echo "Running update" sudo pacman --noconfirm -Syu sudo pacman --noconfirm --needed -S $(cat ~/.dotfiles/arch-setup/nonAUR.txt) +sudo rm -rf /etc/urlview/system.urlview yay -S --noconfirm --needed $(cat ~/.dotfiles/arch-setup/AUR.txt) # Initial cleanup diff --git a/local/bin/daily-update b/local/bin/daily-update index 5682321b..1a99986d 100755 --- a/local/bin/daily-update +++ b/local/bin/daily-update @@ -9,22 +9,22 @@ cached=$(cat /tmp/day_cache) if [ $hour -le $morning ]; then if [ ! "$cached" = "night" ]; then - feh --bg-fill /home/yigit/.local/backgrounds/wallpaper-shack.jpg + feh --no-fehbg --bg-fill /home/yigit/.local/backgrounds/wallpaper-shack.jpg echo "night" > /tmp/day_cache fi elif [ $night -le $hour ]; then if [ ! "$cached" = "night" ]; then - feh --bg-fill /home/yigit/.local/backgrounds/wallpaper-shack.jpg + feh --no-fehbg --bg-fill /home/yigit/.local/backgrounds/wallpaper-shack.jpg echo "night" > /tmp/day_cache fi elif [ $afternoon -le $hour ]; then if [ ! "$cached" = "afternoon" ]; then - feh --bg-fill /home/yigit/.local/backgrounds/wallpaper-sea.jpg + feh --no-fehbg --bg-fill /home/yigit/.local/backgrounds/wallpaper-sea.jpg echo "afternoon" > /tmp/day_cache fi else if [ ! "$cached" = "morning" ]; then - feh --bg-fill /home/yigit/.local/backgrounds/wallpaper-mountain.jpg + feh --no-fehbg --bg-fill /home/yigit/.local/backgrounds/wallpaper-mountain.jpg echo "morning" > /tmp/day_cache fi fi diff --git a/local/bin/dmenu-refresh b/local/bin/dmenu-refresh index c1e1fdd7..e9ca0650 100755 --- a/local/bin/dmenu-refresh +++ b/local/bin/dmenu-refresh @@ -19,7 +19,9 @@ mconnect dunst clipmenud quark -devmon" +devmon +mpd +mpd-mpris" # Open menu selection=$(printf '%s' "$items" | $DMENU) @@ -46,6 +48,10 @@ case $selection in mpd & mpd-mpris & ;; + mpd-mpris) + kill -9 $(pidof mpd-mpris) + mpd-mpris & + ;; dunst) kill -9 $(pidof dunst) dunst & diff --git a/profile b/profile index 79d92df2..17f974d9 100755 --- a/profile +++ b/profile @@ -71,3 +71,5 @@ export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc export WAKATIME_HOME="$XDG_CONFIG_HOME/wakatime" export XSERVERRC="$XDG_CONFIG_HOME"/X11/xserverrc export XINITRC="$XDG_CONFIG_HOME"/X11/xinitrc +export XAUTHORITY="$XDG_RUNTIME_DIR"/Xauthority +export INPUTRC="$XDG_CONFIG_HOME"/readline/inputrc diff --git a/suckless/dwm/config.h b/suckless/dwm/config.h index a4b5f456..5af45dd7 100644 --- a/suckless/dwm/config.h +++ b/suckless/dwm/config.h @@ -55,8 +55,8 @@ static const Layout layouts[] = { const char *spcmd1[] = {"st", "-c", "scratchpad", "-n", "spterm", "-g", "120x34", NULL }; const char *spcmd2[] = {"feh", "--title", "scratchpad", "--class", "spfeh", "-g","900x300+500+350", "/home/yigit/Pictures/us_keyboard.png", NULL}; const char *spcmd3[] = {"st", "-c", "scratchpad", "-n", "spmutt", "-g", "180x51", "-e", "neomutt", NULL }; -static const char *spcmd4[] = { "/usr/local/bin/st", "-g", "140x45", "-c", "spfile", "-n", "spfile", "-e", "/home/yigit/.local/share/bin/lf-ueberzug", NULL }; -static const char *spcmd5[] = { "/usr/local/bin/st", "-g", "140x45", "-c", "spmusic", "-n", "spmusic", "-e", "ncmpcpp", NULL }; +static const char *spcmd4[] = { "/usr/local/bin/st", "-g", "150x35", "-c", "spfile", "-n", "spfile", "-e", "/home/yigit/.local/share/bin/lf-ueberzug", NULL }; +static const char *spcmd5[] = { "/usr/local/bin/st", "-g", "150x35", "-c", "spmusic", "-n", "spmusic", "-e", "ncmpcpp", NULL }; static Sp scratchpads[] = { {"spterm", spcmd1},