Browse Source

Minor changes

main
Yiğit Çolakoğlu 4 years ago
parent
commit
ffd1e0e504
11 changed files with 133 additions and 173 deletions
  1. +96
    -159
      config/lf/lfrc
  2. +10
    -2
      config/ncmpcpp/bindings
  3. +1
    -0
      config/readline/.inputrc
  4. +1
    -1
      config/zsh/aliases
  5. +5
    -0
      config/zsh/bm-dirs
  6. +4
    -4
      config/zsh/fzf.zsh
  7. +1
    -0
      install.sh
  8. +4
    -4
      local/bin/daily-update
  9. +7
    -1
      local/bin/dmenu-refresh
  10. +2
    -0
      profile
  11. +2
    -2
      suckless/dwm/config.h

+ 96
- 159
config/lf/lfrc View File

@ -1,69 +1,85 @@
# Basic Settings
# Yeet's lf settings
# Basic vars
set previewer lf-ueberzug-previewer set previewer lf-ueberzug-previewer
set cleaner lf-ueberzug-cleaner set cleaner lf-ueberzug-cleaner
set preview true set preview true
set hidden true
set drawbox true set drawbox true
set icons true set icons true
set ignorecase 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 ${{ 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 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 "$fx" > /tmp/c
echo convert "$fx" "$HOME/.local/backgrounds/wall.jpg" > /tmp/d echo convert "$fx" "$HOME/.local/backgrounds/wall.jpg" > /tmp/d
convert "$fx" "$HOME/.local/backgrounds/wall.jpg" 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 ${{ cmd git_branch ${{
git branch | fzf | xargs git checkout git branch | fzf | xargs git checkout
pwd_shell=$(pwd) pwd_shell=$(pwd)
@ -71,22 +87,6 @@ cmd git_branch ${{
lf -remote "send $id cd \"$pwd_shell\"" 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 &{{ cmd on-cd &{{
# display git repository status in your prompt # display git repository status in your prompt
source /usr/share/git/completion/git-prompt.sh source /usr/share/git/completion/git-prompt.sh
@ -100,109 +100,40 @@ cmd on-cd &{{
lf -remote "send $id set promptfmt \"$fmt\"" 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 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 <c-f> $lf -remote "send $id select '$(fzf)'"
map gh
map gg top
map D delete map D delete
map p paste
map dd cut
map y copy
map <enter> 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 <c-n> push :mkdir<space>
map <c-r> reload
map <c-s> set hidden!
map <enter> 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<c-u> # new rename
map I push A<c-a> # at the very beginning
map i push A<a-b><a-b><a-f> # before extention
map a push A<a-b> # after extention
map B bulkrename
map b setbg
map <c-e> down
map <c-y> up
map V push :!vim<space>
map cd push !cd<space>
# Movement # Movement
map ~ cd ~ map ~ cd ~
map g/ cd / map g/ cd /
@ -211,3 +142,9 @@ map gd cd ~/.dotfiles
map gc cd ~/.config map gc cd ~/.config
map gs cd ~/.local/share/bin 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}}

+ 10
- 2
config/ncmpcpp/bindings View File

@ -45,8 +45,6 @@
#def_key "end" #def_key "end"
# move_end # move_end
# #
#def_key "insert"
# select_item
# #
#def_key "enter" #def_key "enter"
# enter_directory # enter_directory
@ -467,3 +465,13 @@ def_key "f"
seek_forward seek_forward
def_key "b" def_key "b"
seek_backward 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

+ 1
- 0
config/readline/.inputrc View File

@ -0,0 +1 @@
set enable-keypad on

+ 1
- 1
config/zsh/aliases View File

@ -1,6 +1,6 @@
#!/usr/bin/zsh #!/usr/bin/zsh
alias feh="feh --scale-down --auto-zoom"
alias feh="feh --scale-down --auto-zoom --no-fehbg"
alias cclear="$(which clear)" alias cclear="$(which clear)"
alias clear="clear && paleofetch" alias clear="clear && paleofetch"
alias neofetch="neofetch --ascii ~/.config/neofetch/ascii.txt" alias neofetch="neofetch --ascii ~/.config/neofetch/ascii.txt"


+ 5
- 0
config/zsh/bm-dirs View File

@ -0,0 +1,5 @@
~/Downloads
~/Pictures
~/Projects
~/Documents
~/Nextcloud

+ 4
- 4
config/zsh/fzf.zsh View File

@ -1,13 +1,13 @@
# Setup fzf # 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 fi
# Auto-completion # 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 # Key bindings
# ------------ # ------------
source "/home/yigit/.fzf/shell/key-bindings.zsh"
source "/home/yigit/.local/share/fzf/shell/key-bindings.zsh"

+ 1
- 0
install.sh View File

@ -18,6 +18,7 @@ fi
echo "Running update" echo "Running update"
sudo pacman --noconfirm -Syu sudo pacman --noconfirm -Syu
sudo pacman --noconfirm --needed -S $(cat ~/.dotfiles/arch-setup/nonAUR.txt) 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) yay -S --noconfirm --needed $(cat ~/.dotfiles/arch-setup/AUR.txt)
# Initial cleanup # Initial cleanup


+ 4
- 4
local/bin/daily-update View File

@ -9,22 +9,22 @@ cached=$(cat /tmp/day_cache)
if [ $hour -le $morning ]; then if [ $hour -le $morning ]; then
if [ ! "$cached" = "night" ]; 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 echo "night" > /tmp/day_cache
fi fi
elif [ $night -le $hour ]; then elif [ $night -le $hour ]; then
if [ ! "$cached" = "night" ]; 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 echo "night" > /tmp/day_cache
fi fi
elif [ $afternoon -le $hour ]; then elif [ $afternoon -le $hour ]; then
if [ ! "$cached" = "afternoon" ]; 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 echo "afternoon" > /tmp/day_cache
fi fi
else else
if [ ! "$cached" = "morning" ]; then 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 echo "morning" > /tmp/day_cache
fi fi
fi fi

+ 7
- 1
local/bin/dmenu-refresh View File

@ -19,7 +19,9 @@ mconnect
dunst dunst
clipmenud clipmenud
quark quark
devmon"
devmon
mpd
mpd-mpris"
# Open menu # Open menu
selection=$(printf '%s' "$items" | $DMENU) selection=$(printf '%s' "$items" | $DMENU)
@ -46,6 +48,10 @@ case $selection in
mpd & mpd &
mpd-mpris & mpd-mpris &
;; ;;
mpd-mpris)
kill -9 $(pidof mpd-mpris)
mpd-mpris &
;;
dunst) dunst)
kill -9 $(pidof dunst) kill -9 $(pidof dunst)
dunst & dunst &


+ 2
- 0
profile View File

@ -71,3 +71,5 @@ export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc
export WAKATIME_HOME="$XDG_CONFIG_HOME/wakatime" export WAKATIME_HOME="$XDG_CONFIG_HOME/wakatime"
export XSERVERRC="$XDG_CONFIG_HOME"/X11/xserverrc export XSERVERRC="$XDG_CONFIG_HOME"/X11/xserverrc
export XINITRC="$XDG_CONFIG_HOME"/X11/xinitrc export XINITRC="$XDG_CONFIG_HOME"/X11/xinitrc
export XAUTHORITY="$XDG_RUNTIME_DIR"/Xauthority
export INPUTRC="$XDG_CONFIG_HOME"/readline/inputrc

+ 2
- 2
suckless/dwm/config.h View File

@ -55,8 +55,8 @@ static const Layout layouts[] = {
const char *spcmd1[] = {"st", "-c", "scratchpad", "-n", "spterm", "-g", "120x34", NULL }; 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 *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 }; 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[] = { static Sp scratchpads[] = {
{"spterm", spcmd1}, {"spterm", spcmd1},


Loading…
Cancel
Save