vdotfiles

Cem's Dotfiles for Void Linux
git clone git://git.ckyln.com/vdotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit 4bf17ea7a98dc5d20169db9df180783fb2e42e47
parent bef6991e6d982f49026793dbd5b26f16a15b67c2
Author: Cem Keylan <warc1998@gmail.com>
Date:   Tue, 11 Jun 2019 14:06:54 +0300

Minor adjustments

Diffstat:
M.bashrc | 18++++++++++++------
M.config/i3/config | 18+++++++++---------
M.config/polybar/config | 58++++++++++++++++++++++------------------------------------
MREADME.md | 2+-
Mbin/cfi | 4++--
Mbin/cfp | 3++-
Mbin/checkmail | 4+++-
Mbin/dmenumount | 6+++---
Mbin/dmenuumount | 4++--
Mbin/nightmodetoggle | 4++++
Mbin/sdmenu | 2+-
Mbin/todo | 2+-
Mbin/todoadd | 23++++++++++++++++++++++-
Mbin/todorm | 13++++++-------
Mbin/updot | 4++--
Mbin/wallset | 1+
16 files changed, 93 insertions(+), 73 deletions(-)

diff --git a/.bashrc b/.bashrc @@ -1,8 +1,13 @@ -# _ _ -# | |__ __ _ ___| |__ _ __ ___ -# | '_ \ / _` / __| '_ \| '__/ __| -# _| |_) | (_| \__ \ | | | | | (__ -#(_)_.__/ \__,_|___/_| |_|_| \___| +# +# ██████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ +# ██╔══██╗██╔══██╗██╔════╝██║ ██║██╔══██╗██╔════╝ +# ██████╔╝███████║███████╗███████║██████╔╝██║ +# ██╔══██╗██╔══██║╚════██║██╔══██║██╔══██╗██║ +# ██╗██████╔╝██║ ██║███████║██║ ██║██║ ██║╚██████╗ +# ╚═╝╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ + + +## Most of this bashrc is from Manjaro [[ $- != *i* ]] && return @@ -109,10 +114,11 @@ if ${use_color} ; then if [[ ${EUID} == 0 ]] ; then PS1='\[\033[01;31m\][\h\[\033[01;36m\] \W\[\033[01;31m\]]\$\[\033[00m\] ' else - PS1="\[${BYellow}\]\u\[${BGreen}\]@\[${BCyan}\]\h\[${BWhite}\] \[${BRed}\]\W\[${BWhite}\]\[${BGreen}\] \[${BCyan}\]->\[${NC}\] " + PS1="\[\e]2;\u --> \w\a\]\[${BYellow}\]\u\[${BGreen}\]@\[${BCyan}\]\h\[${BWhite}\] \[${BRed}\]\W\[${BWhite}\]\[${BGreen}\] \[${BCyan}\]->\[${NC}\] " fi alias ls='ls --color=auto' + alias ll='ls --color=auto -a' alias grep='grep --colour=auto' alias egrep='egrep --colour=auto' alias fgrep='fgrep --colour=auto' diff --git a/.config/i3/config b/.config/i3/config @@ -11,16 +11,16 @@ ######## Default Programs ######### # Terminal -set $term terminator +set $term st # Browser set $brow qutebrowser # File Manager -set $fm terminator -e "lf && exit" +set $fm st -e lf && exit # Music Player -set $music terminator -e "ncmpcpp && exit" +set $music st -e ncmpcpp && exit ################################### @@ -168,7 +168,7 @@ bindsym $mod+r mode "resize" # Auto Locking -exec --no-startup-id xautolock -time 10 -locker 'i3lock-fancy' +exec --no-startup-id xautolock -time 10 -locker 'betterlockscreen --lock' # Pulse Audio controls bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5% && mpv /usr/share/sounds/LinuxMint/stereo/volume.oga #increase sound volume @@ -216,22 +216,22 @@ bindsym $mod+n exec $fm bindsym $mod+o exec $brow # Launch Terminal -bindsym $mod+Return exec $term +bindsym $mod+Return exec st # Launch Console Music Player bindsym $mod+m exec --no-startup-id $music # Application Launcher -bindsym $mod+d exec --no-startup-id i3-dmenu-desktop +bindsym $mod+d exec --no-startup-id i3-dmenu-desktop --dmenu='dmenu -i -l 15' # Command Launcher -bindsym $mod+u exec --no-startup-id dmenu_run +bindsym $mod+u exec --no-startup-id dmenu_run -l 15 # Launch Mutt -bindsym $mod+Shift+m exec --no-startup-id $term -e "neomutt && exit" +bindsym $mod+Shift+m exec --no-startup-id $term -e neomutt && exit # Launch Calcurse -bindsym $mod+c exec --no-startup-id $term -e "calcurse && exit" +bindsym $mod+c exec --no-startup-id $term -e calcurse && exit # Mount USB bindsym $altmod+m exec --no-startup-id $HOME/bin/dmenumount diff --git a/.config/polybar/config b/.config/polybar/config @@ -54,9 +54,9 @@ font-2 = siji:pixelsize=10;1 font-3 = Material Icons:style=Regular:size=13;4 font-color = #000 -modules-left = dmenu mlaunch mpd -modules-center = title -modules-right = backlight pulseaudio wlan eth battery mailcheck calcurse time powermenu +modules-left = time +modules-center = mpd +modules-right = backlight pulseaudio wlan eth battery mailcheck calcurse powermenu tray-position = none @@ -87,9 +87,9 @@ font-1 = unifont:fontformat=truetype:size=8:antialias=false;0 font-2 = siji:pixelsize=10;1 font-3 = Material Icons:style=Regular:size=13;4 -modules-left = dmenu mlaunch mpd -modules-center = title -modules-right = backlight pulseaudio wlan eth battery mailcheck calcurse time powermenu +modules-left = time +modules-center = mpd +modules-right = backlight pulseaudio wlan eth battery mailcheck calcurse powermenu tray-position = none @@ -121,7 +121,7 @@ font-1 = unifont:fontformat=truetype:size=8:antialias=false;0 font-2 = siji:pixelsize=10;1 font-3 = Material Icons:style=Regular:size=13;4 -modules-left = i3 bspwm +modules-left = i3 bspwm title modules-center = todo modules-right = wl nightmode xkeyboard filesystem rootfs memory cpu @@ -156,7 +156,7 @@ font-1 = unifont:fontformat=truetype:size=8:antialias=false;0 font-2 = siji:pixelsize=10;1 font-3 = Material Icons:style=Regular:size=13;4 -modules-left = i3 bspwm +modules-left = i3 bspwm title modules-center = todo modules-right = wl nightmode xkeyboard filesystem rootfs memory cpu @@ -195,17 +195,6 @@ label-empty-padding = 2 ; Separator in between workspaces ; label-separator = | -[module/dmenu] -type = custom/text - -click-left = i3-dmenu-desktop -click-middle = i3-dmenu-desktop -click-right = i3-dmenu-desktop -content-prefix = " " -content = " Navigate" -;content-suffix-foreground = #fff -;content-prefix-foreground = ${root.primary} - [module/mlaunch] type = custom/text @@ -290,23 +279,24 @@ label-unmounted-foreground = ${colors.alert} [module/mpd] type = internal/mpd -format-online = <label-song> <icon-prev> <icon-stop> <toggle> <icon-next> <label-time> +format-online = <label-song> <label-time> +;format-online = <label-song> <icon-prev> <icon-stop> <toggle> <icon-next> <label-time> interval = 0.5 host = localhost port = 6600 label-time = " %elapsed% / %total%" label-song = %artist% - %title% -icon-prev =  -icon-stop =  -icon-play =  -icon-pause =  -icon-next =  -icon-prev-foreground = #00aaff -icon-next-foreground = #00aaff -icon-stop-foreground = #ff0000 -icon-play-foreground = #00aa00 -icon-pause-foreground = #ecec00 +;icon-prev =  +;icon-stop =  +;icon-play =  +;icon-pause =  +;icon-next =  +;icon-prev-foreground = #00aaff +;icon-next-foreground = #00aaff +;icon-stop-foreground = #ff0000 +;icon-play-foreground = #00aa00 +;icon-pause-foreground = #ecec00 format-offline = <label-offline> label-offline = @@ -402,13 +392,9 @@ click-right = $HOME/bin/dwatch type = internal/date interval = 1 -date = "%A" -date-alt ="%e %B %Y" - -time = " %H:%M" -time-alt = " %H:%M:%S" +time = " %H:%M" -label = %date% %time% +label = %time% [module/pulseaudio] type = internal/pulseaudio diff --git a/README.md b/README.md @@ -2,7 +2,7 @@ These can be installed using ```shell -curl -LO gitlab.cemkeylan.com/cemkeylan/carbs/raw/master/carbs && bash carbs +curl -LO git.ckyln.com/cemkeylan/carbs/raw/master/carbs && bash carbs ``` ## Screenshots diff --git a/bin/cfi b/bin/cfi @@ -1,7 +1,7 @@ #!/bin/sh echo $HOME/.config/i3/config | entr -p -n /usr/bin/i3 restart >/dev/null 2>&1 & +ENTR=$! nvim $HOME/.config/i3/config sleep 1 -[ -z "$(pidof entr)" ] && exit -kill $(pidof entr) +kill $ENTR diff --git a/bin/cfp b/bin/cfp @@ -1,7 +1,8 @@ #!/bin/sh echo $HOME/.config/polybar/config | entr -p -n /home/cem/bin/polyrestart >/dev/null 2>&1 & +ENTR=$! nvim $HOME/.config/polybar/config sleep 1 [ -z "$(pidof entr)" ] && exit -kill $(pidof entr) +kill $ENTR diff --git a/bin/checkmail b/bin/checkmail @@ -2,7 +2,9 @@ if [ -d $HOME/.local/share/mail ] then - echo -e " $(echo "$(du -a ~/.local/share/mail/*/INBOX/new/* 2>/dev/null | sed -n '$=')$(cat /tmp/imapsyncicon_$USER 2>/dev/null || echo 0)" + [ -z "$(echo -e "$(echo "$(du -a ~/.local/share/mail/*/INBOX/new/* 2>/dev/null | sed -n '$=')$(cat /tmp/imapsyncicon_$USER 2>/dev/null)") ")" ] && echo " 0" && exit + + echo -e " $(echo "$(du -a ~/.local/share/mail/*/INBOX/new/* 2>/dev/null | sed -n '$=')$(cat /tmp/imapsyncicon_$USER 2>/dev/null)" ) " else Mailbox cannot be found diff --git a/bin/dmenumount b/bin/dmenumount @@ -6,16 +6,16 @@ getmount() { \ [ -z "$chosen" ] && exit 1 - mp="$(find $1 2>/dev/null | dmenu -i -p "Type in mount point.")" + mp="$(find $1 2>/dev/null | dmenu -l 15 -i -p "Type in mount point.")" [ "$mp" = "" ] && exit 1 if [ ! -d "$mp" ]; then - mkdiryn=$(printf "No\\nYes" | dmenu -i -p "$mp does not exist. Create it?") + mkdiryn=$(printf "No\\nYes" | dmenu -l 15 -i -p "$mp does not exist. Create it?") [ "$mkdiryn" = "Yes" ] && (mkdir -p "$mp" || sudo -A mkdir -p "$mp") fi } mountusb() { \ - chosen="$(echo "$usbdrives" | dmenu -i -p "Mount which drive?" | awk '{print $1}')" + chosen="$(echo "$usbdrives" | dmenu -l 15 -i -p "Mount which drive?" | awk '{print $1}')" sudo -A mount "$chosen" 2>/dev/null && notify-send "💻 USB mounting" "$chosen mounted." && exit 0 alreadymounted=$(lsblk -nrpo "name,type,mountpoint" | awk '$2=="part"&&$3!~/\/boot|\/home$|SWAP/&&length($3)>1{printf "-not \\( -path *%s -prune \\) \\ \n",$3}') getmount "/mnt /media /mount /home -maxdepth 5 -type d $alreadymounted" diff --git a/bin/dmenuumount b/bin/dmenuumount @@ -5,9 +5,9 @@ unmountusb() { [ -z "$drives" ] && exit - chosen=$(echo "$drives" | dmenu -i -p "Unmount which drive?" | awk '{print $1}') + chosen=$(echo "$drives" | dmenu -l 15 -i -p "Unmount which drive?" | awk '{print $1}') [ -z "$chosen" ] && exit - sudo -A umount "$chosen" && notify-send "USB unmounting" "$chosen unmounted." + sudo -A umount -R "$chosen" && notify-send "USB unmounting" "$chosen unmounted." } drives=$(lsblk -nrpo "name,type,size,mountpoint" | awk '$2=="part"&&$4!~/\/boot|\/home$|SWAP/&&length($4)>1{printf "%s (%s)\n",$4,$3}') diff --git a/bin/nightmodetoggle b/bin/nightmodetoggle @@ -42,6 +42,8 @@ then if [ $(tail -n -1 $HOME/.night) = "NIGHT=1" ] then feh --bg-fill --randomize $HOME/Pictures/Wallpapers/Night/* + pidof betterlockscreen | xargs -r kill + cat $HOME/.fehbg | awk '{print $3}' | xargs -r betterlockscreen -u >/dev/null 2>&1 & case $(ps aux | grep -i polybar) in *night*) exit @@ -52,6 +54,8 @@ then esac else feh --bg-fill --randomize $HOME/Pictures/Wallpapers/Morning/* + pidof betterlockscreen | xargs -r kill + cat $HOME/.fehbg | awk '{print $3}' | xargs -r betterlockscreen -u >/dev/null 2>&1 & case $(ps aux | grep -i polybar | head -n +1 -) in *"polybar -q top") exit diff --git a/bin/sdmenu b/bin/sdmenu @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh choice="$(printf "Suspend\nShutdown\nReboot" | dmenu -l 3 -p "Power Menu")" diff --git a/bin/todo b/bin/todo @@ -9,5 +9,5 @@ then echo "Nothing to do!" fi else - calcurse -t | sed 1d - | head -n 1 - | cut -c 4- + cat $HOME/.calcurse/todo | head -n 1 - | cut -c 5- fi diff --git a/bin/todoadd b/bin/todoadd @@ -2,4 +2,25 @@ # Add to todo.txt file -pacman -Q calcurse >/dev/null 2>&1 && echo "There is currently no way to add a todo entry to Calcurse" || echo $1 | tee -a $HOME/todo.txt +# pacman -Q calcurse >/dev/null 2>&1 && echo "There is currently no way to add a todo entry to Calcurse" || echo $1 | tee -a $HOME/todo.txt + + +if [ -z "$(pacman -T calcurse)" ] +then + if [ -z $1 ] + then + printf "Add a todo item: " + read todo + printf "Set priority [0-9]: " + read pri + re='^[0-9]+$' + if ! [[ $pri =~ $re ]] ; then + echo "error: Not a number" >&2; exit 1 + fi + echo -e "[$pri] $todo" >> $HOME/.calcurse/todo + else + echo $1 | xargs -r echo [0] | tee -a $HOME/.calcurse/todo + fi +else + echo $1 | tee -a $HOME/todo.txt +fi diff --git a/bin/todorm b/bin/todorm @@ -1,9 +1,8 @@ #!/bin/sh -# Removes the first line of todo.txt - -tradtodo() {\ - tail -n +2 $HOME/todo.txt > $HOME/todo.txt.tmp && mv $HOME/todo.txt.tmp $HOME/todo.txt -} - -pacman -Q calcurse >/dev/null 2>&1 && echo "There is currently no way to remove an entry from calcurse" || tradtodo +if [ -z $(pacman -T calcurse) ] +then + tail -n +2 $HOME/.calcurse/todo > $HOME/.calcurse/todo.tmp && mv $HOME/.calcurse/todo.tmp $HOME/.calcurse/todo +else + tail -n +2 $HOME/todo.txt > $HOME/todo.txt.tmp && mv $HOME/todo.txt.tmp $HOME/todo.txt +fi diff --git a/bin/updot b/bin/updot @@ -1,7 +1,7 @@ -#!/bin/sh +#!/bin/bash -git clone https://gitlab.cemkeylan.com/cemkeylan/dotfiles.git +git clone https://git.ckyln.com/cemkeylan/dotfiles.git cd dotfiles BASE=$PWD if [ $RCUP = "YES" ] diff --git a/bin/wallset b/bin/wallset @@ -13,5 +13,6 @@ then exit else feh --bg-fill $HOME/Pictures/Wallpapers/$nightmode/$selection + cat $HOME/.fehbg | awk '{print $3}' | xargs -r betterlockscreen -u >/dev/null 2>&1 & notify-send 'New wallpaper' 'Your wallpaper has been changed !' fi