From 18f105cea0a666aca23ea4b4e1abd5185855cf3e Mon Sep 17 00:00:00 2001 From: ziro Date: Sat, 23 May 2020 13:49:13 +0700 Subject: [PATCH] ----- Changes: + Rework a lot of stuff --- .config/bspwm/bspwmrc | 1 + .config/lf/lfrc | 7 +++++-- .config/polybar/config | 2 +- .config/polybar/scripts/disk.sh | 2 +- .config/zsh/.zshenv | 3 ++- .config/zsh/aliases | 5 ++++- .local/bin/custom/rateUSD | 14 +++++++++++++- .scripts/play.sh | 2 +- .scripts/video.sh | 4 +++- 9 files changed, 31 insertions(+), 9 deletions(-) diff --git a/.config/bspwm/bspwmrc b/.config/bspwm/bspwmrc index b34c984..1d00a17 100755 --- a/.config/bspwm/bspwmrc +++ b/.config/bspwm/bspwmrc @@ -75,3 +75,4 @@ bspc rule -a qTox:qtox desktop='^9' bspc rule -a pr:pr desktop='^10' bspc rule -a firefox:Toolkit desktop='^3' state=floating bspc rule -a mpv:gl state=floating +bspc rule -a mpv state=floating diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 54097cc..06b57d9 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -1,4 +1,3 @@ -set previewer ~/.config/lf/preview # Config set preview true #set previewer ~/.config/lf/preview @@ -9,6 +8,8 @@ set color256 set hidden true set ignorecase true set smartcase true +set shellopts '-eu' +set ifs "\n" # Custom Functions cmd open ${{ @@ -41,7 +42,9 @@ cmd touch $touch "$(echo $* | tr ' ' '\ ')" cmd q :quit -cmd chmod $chmod "$*" "$f" +cmd chmod ${{ + chmod $1 $fx +}} cmd rename %[ -e $1 ] && printf "file exists" || mv $f $1 diff --git a/.config/polybar/config b/.config/polybar/config index e99c9f8..41cac87 100755 --- a/.config/polybar/config +++ b/.config/polybar/config @@ -651,7 +651,7 @@ format-padding = 1 [module/currency] type = custom/script -exec = "rateUSD -" +exec = "rateUSD -s" interval = 16000 tail = true label = "$1 = Rp.%output%" diff --git a/.config/polybar/scripts/disk.sh b/.config/polybar/scripts/disk.sh index bdb6d6b..1ac6f79 100755 --- a/.config/polybar/scripts/disk.sh +++ b/.config/polybar/scripts/disk.sh @@ -5,5 +5,5 @@ warn="" [ $capacity -lt 21 ] && warn='!' -printf "%s%s" "$warn " "$(echo $capacity | sed "s/$/G free/")" +printf "%s%s\n" "$warn " "$(echo $capacity | sed "s/$/G free/")" diff --git a/.config/zsh/.zshenv b/.config/zsh/.zshenv index ce51a7f..eb088cb 100644 --- a/.config/zsh/.zshenv +++ b/.config/zsh/.zshenv @@ -17,7 +17,8 @@ export READER='zathura' export MANPAGER="/bin/sh -c \"col -b | vim --not-a-term -c 'set ft=man ts=8 nomod nolist noma' -\"" # SUDO -export SUDO_ASKPASS=/bin/rofi-askpass +#export SUDO_ASKPASS=/bin/rofi-askpass +export SUDO_ASKPASS="/bin/dmenu-askpass" # XDG export XDG_CACHE_HOME="$HOME/.cache" diff --git a/.config/zsh/aliases b/.config/zsh/aliases index a0508ef..b7fa64d 100644 --- a/.config/zsh/aliases +++ b/.config/zsh/aliases @@ -1,7 +1,7 @@ #!/usr/bin/env bash #sudo -alias sudo='sudo ' +[ "x$(pgrep startx)" = "x" ] && alias sudo='sudo ' || alias sudo='sudo --askpass ' #sudo + vim, yea imagine having that powe- nvm alias sudovim='sudoedit' @@ -83,7 +83,10 @@ alias cp='cp -i' alias mntfd='sudo mount -o gid=users,fmask=113,dmask=002' alias umntfd='sudo umount' alias cmatrix='unimatrix -n -s 96 -l 'o'' + +#folder shortcut alias cdclg='cd "$HOME/my Files/Kuliah/"' +alias cdwine='cd "$HOME/.local/share/wineprefixes/"' #Git Aliases alias gR='git restore' diff --git a/.local/bin/custom/rateUSD b/.local/bin/custom/rateUSD index a304760..cd608b6 100755 --- a/.local/bin/custom/rateUSD +++ b/.local/bin/custom/rateUSD @@ -2,8 +2,20 @@ # get rate value from cnbcindonesia.com [ ! "$(stat -c %y ~/.cache/rateUSD.txt 2> /dev/null | cut -d' ' -f1)" = "$(date +"%Y-%m-%d")" ] && curl -s "https://www.cnbcindonesia.com/market-data/currencies/IDR=/USD-IDR" | grep -A1 'class="mark_val"' | cut -d'"' -f2 | cut -d'<' -f2 | cut -d'>' -f2 > ~/.cache/rateUSD.txt +# short="FALSE" +# usage() { echo "Usage: dmenugames [-t GAMETYPE]" 1>&2; exit 1; } +# while getopts s option +# do +# case $option in +# s) short="TRUE";; +# ?) usage;; +# esac +# done +# shift "$((OPTIND-1))" +# [ "short" = "FALSE" ] && usage + enUS='Rate' idID='Kurs' lang=$idID # display rateUSD.txt while replace mark_val with Kurs USD -> IDR: -[ -z $1 ] && sed "s/mark_val/$lang USD -> IDR:/;2 s/^/Rp./" ~/.cache/rateUSD.txt && echo "Sumber: CNBC Indonesia" || grep -A1 "mark" ~/.cache/rateUSD.txt | grep -v "mark" +[ ! "$1" = "-s" ] && sed "s/mark_val/$lang USD -> IDR:/;2 s/^/Rp./" ~/.cache/rateUSD.txt && echo "Sumber: CNBC Indonesia" || grep -A1 "mark" ~/.cache/rateUSD.txt | grep -v "mark" diff --git a/.scripts/play.sh b/.scripts/play.sh index 9b67b88..3e3361a 100755 --- a/.scripts/play.sh +++ b/.scripts/play.sh @@ -28,7 +28,7 @@ chosen=$(echo -e "$choices" | rofi -p Games -dmenu -i -theme ~/.config/rofi/them case "$chosen" in RetroArch) notify-send "Launching..." "$chosen" && retroarch ;; $pc) games -t PC ;; - PS2) sh $HOME/.scripts/games/ps2.sh ;; + PS2) games -t PS2 ;; NDS) sh $HOME/.scripts/games/nds.sh ;; $trids) games -t 3DS ;; Steam) notify-send "Launching..." "$chosen" && steam ;; diff --git a/.scripts/video.sh b/.scripts/video.sh index 3da2083..86ad0f7 100755 --- a/.scripts/video.sh +++ b/.scripts/video.sh @@ -4,7 +4,8 @@ Electron Player\0icon\x1fzE KODI\0icon\x1fzkodi Twitch\0icon\x1fztwitch VLC\0icon\x1fzvlc -YouTube\0icon\x1fzyt" +YouTube\0icon\x1fzyt +Play link on MPV" message="What video player do you want to launch?" @@ -16,6 +17,7 @@ case "$chosen" in VLC) notify-send "Launching..." "VLC" && vlc ;; YouTube) notify-send "Launching..." "$chosen" && urxvt -e youtube-viewer ;; Twitch) notify-send "Launching..." "$chosen" && urxvt -e twitch-curses ;; + "Play link on MPV") mpv-link ;; esac