dotfiles

Cem's Dotfiles
git clone git://git.ckyln.com/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit 598983aad3a5f36fbdb533828416da92bc9c9c82
parent 1fec506af5cd1d35bcd1e695175f1f8fabf13a1f
Author: Cem Keylan <warc1998@gmail.com>
Date:   Thu, 23 May 2019 14:09:36 +0300

Completed Rice (lol for now)

Diffstat:
M.bashrc | 15++++++++++++---
M.config/i3/config | 16+++++++++++-----
M.config/polybar/config | 187+++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------
M.config/terminator/config | 3++-
D.fehbg | 2--
Abin/checkforvpn | 8++++++++
Abin/nightmodecheck | 30++++++++++++++++++++++++++++++
Abin/nightmodetoggle | 62++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mbin/polyrestart | 34++++++++++++++++++++++++++++++----
Abin/testt | 50++++++++++++++++++++++++++++++++++++++++++++++++++
Abin/vpnswitch | 9+++++++++
Mbin/wallset | 11+++++++++--
Abin/yousure | 8++++++++
Abin/yousurereb | 8++++++++
14 files changed, 366 insertions(+), 77 deletions(-)

diff --git a/.bashrc b/.bashrc @@ -1,6 +1,8 @@ -# -# ~/.bashrc -# +# _ _ +# | |__ __ _ ___| |__ _ __ ___ +# | '_ \ / _` / __| '_ \| '__/ __| +# _| |_) | (_| \__ \ | | | | | (__ +#(_)_.__/ \__,_|___/_| |_|_| \___| [[ $- != *i* ]] && return @@ -97,6 +99,10 @@ alias np='nano -w PKGBUILD' alias more=less alias ncmpcpp="ncmpcpp --port 6601" alias rm='rm -v' +alias ccat="highlight" +alias mutt="neomutt" +alias cfb="vim $HOME/.bashrc" +alias sb="source $HOME/.bashrc" xhost +local:root > /dev/null 2>&1 @@ -148,3 +154,6 @@ export PATH=/home/cem/.gem/ruby/2.6.0/bin/:$PATH export PATH=/home/cem/bin/:$PATH export PATH=/home/cem/.scripts/:$PATH export PATH=/usr/local/bin/:$PATH +export VPNCONFIG=$HOME/auto.ovpn +export EDITOR="vim" +alias dot="cd $HOME/dotfiles" diff --git a/.config/i3/config b/.config/i3/config @@ -181,7 +181,14 @@ bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle && mpv / bindsym XF86MonBrightnessUp exec xbacklight -inc 10 # increase screen brightness bindsym XF86MonBrightnessDown exec xbacklight -dec 10 # decrease screen brightness +# Change Wallpaper +bindsym $altmod+w exec --no-startup-id $HOME/bin/wallset + +# Shutdown Command +bindsym $altmod+Shift+n exec --no-startup-id $HOME/bin/yousure +# Reboot Command +bindsym $altmod+Shift+r exec --no-startup-id $HOME/bin/yousurereb ######## Application Shortcuts ######### @@ -207,13 +214,15 @@ bindsym $mod+d exec --no-startup-id rofi -show drun -theme Arc-Dark # Command Launcher bindsym $mod+u exec --no-startup-id rofi -show run -theme Arc-Dark +# Launch Mutt +bindsym $mod+Shift+m exec --no-startup-id $term -e "neomutt && exit" ######################################## ########### Startup commands ########### -# Set background -exec --no-startup-id /home/cem/.fehbg +# Disable (if override exists for nightmode and set background +exec --no-startup-id $HOME/bin/nightmodetoggle disable # Start Nextcloud Sync Client exec --no-startup-id nextcloud @@ -233,6 +242,3 @@ exec --no-startup-id nm-applet # Launch Policy Kit Daemon exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 - -#Change Wallpaper -bindsym $altmod+w exec --no-startup-id $HOME/bin/wallset diff --git a/.config/polybar/config b/.config/polybar/config @@ -22,20 +22,57 @@ background-alt = #444 foreground = #fff foreground-alt = #fff primary = #1a94ff +mornprim = #bdbdbd secondary = #e60053 alert = #bd2c40 -barback = #aa222222 +barnight = #aa222222 +;barback = #026b5f +;barback = #006f6f +barback = #ffffff [bar/top] -;monitor = ${env:MONITOR:HDMI-1} width = 100% height = 27 -;offset-x = 1% -;offset-y = 1% radius = 0.0 fixed-center = true background = ${colors.barback} +foreground = #222 +primary = ${colors.mornprim} +power = ${colors.alert} + +line-size = 3 +line-color = #f00 + +padding-left = 0 +padding-right = 2 + +module-margin-left = 1 +module-margin-right = 2 + +font-0 = fixed:pixelsize=10;2 +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 +font-color = #000 + +modules-left = rofi mlaunch mpd +modules-center = title +modules-right = backlight pulseaudio wlan eth battery time powermenu + +tray-position = none + +cursor-click = pointer +cursor-scroll = ns-resize + +[bar/topnight] +width = 100% +height = 27 +radius = 0.0 +fixed-center = true +background = ${colors.barnight} foreground = ${colors.foreground} +primary = ${colors.primary} +power = ${self.primary} line-size = 3 line-color = #f00 @@ -61,15 +98,13 @@ cursor-click = pointer cursor-scroll = ns-resize [bar/bottom] -;monitor = ${env:MONITOR:HDMI-1} width = 100% height = 27 -;offset-x = 1% -;offset-y = 1% radius = 0.0 fixed-center = true background = ${colors.barback} -foreground = ${colors.foreground} +foreground = #222 +primary = ${colors.mornprim} bottom = true line-size = 3 @@ -88,22 +123,43 @@ font-3 = Material Icons:style=Regular:size=13;4 modules-left = i3 bspwm modules-center = todo -modules-right = xkeyboard filesystem rootfs memory cpu +modules-right = vpn nightmode xkeyboard filesystem rootfs memory cpu tray-position = right tray-padding = 2 -;tray-background = #0063ff -;wm-restack = bspwm -;wm-restack = i3 +cursor-click = pointer +cursor-scroll = ns-resize + +[bar/bottomnight] +width = 100% +height = 27 +radius = 0.0 +fixed-center = true +background = ${colors.barnight} +foreground = ${colors.foreground} +bottom = true + +line-size = 3 +line-color = #f00 + +padding-left = 0 +padding-right = 2 -;override-redirect = true +module-margin-left = 1 +module-margin-right = 2 + +font-0 = fixed:pixelsize=10;2 +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 -;scroll-up = bspwm-desknext -;scroll-down = bspwm-deskprev +modules-left = i3 bspwm +modules-center = todo +modules-right = vpn nightmode xkeyboard filesystem rootfs memory cpu -;scroll-up = i3wm-wsnext -;scroll-down = i3wm-wsprev +tray-position = right +tray-padding = 2 cursor-click = pointer cursor-scroll = ns-resize @@ -116,7 +172,7 @@ type = internal/bspwm label-focused = %index% label-focused-background = ${colors.background-alt} -label-focused-underline= ${colors.primary} +label-focused-underline= ${root.primary} label-focused-padding = 2 label-occupied = %index% @@ -139,10 +195,10 @@ type = custom/text click-left = rofi -show drun -theme Arc-Dark click-middle = rofi -show drun -theme Arc-Dark click-right = rofi -show drun -theme Arc-Dark -content = " " -content-suffix = " Navigate" -content-suffix-foreground = #fff -content-foreground = ${colors.primary} +content-prefix = " " +content = " Navigate" +;content-suffix-foreground = #fff +;content-prefix-foreground = ${root.primary} [module/mlaunch] type = custom/text @@ -151,7 +207,6 @@ click-right = ario click-left = ario click-middle = ario content =  -content-foreground = #fff [module/i3] type = internal/i3 @@ -164,11 +219,11 @@ wrapping-scroll = false label-mode-padding = 2 label-mode-foreground = #000 -label-mode-background = ${colors.primary} +label-mode-background = ${root.primary} ; focused = Active workspace on focused monitor label-focused = %index% -label-focused-background = ${colors.primary} +label-focused-background = ${root.primary} ;label-focused-background = ${module/bspwm.label-focused-background} label-focused-underline = ${module/bspwm.label-focused-underline} label-focused-padding = ${module/bspwm.label-focused-padding} @@ -176,7 +231,7 @@ label-focused-padding = ${module/bspwm.label-focused-padding} ; unfocused = Inactive workspace on any monitor label-unfocused = %index% label-unfocused-padding = ${module/bspwm.label-occupied-padding} -label-unfocused-underline = ${colors.primary} +label-unfocused-underline = ${root.primary} ; visible = Active workspace on unfocused monitor label-visible = %index% @@ -212,7 +267,6 @@ type = internal/xkeyboard blacklist-0 = num lock format-prefix = " " -format-prefix-foreground = ${colors.primary} label-layout = %layout% | @@ -229,9 +283,7 @@ mount-0 = /home format-mounted= /home : <label-mounted> label-mounted = %percentage_used%% -format-mounted-foreground = ${colors.primary} -label-mounted-foreground = #fff -label-unmounted = %mountpoint% not mounted +/abel-unmounted = %mountpoint% not mounted label-unmounted-foreground = ${colors.alert} @@ -261,20 +313,29 @@ label-offline = label-song-maxlen = 50 label-song-ellipsis = true +[module/nightmode] +type = custom/script +exec = $HOME/bin/nightmodecheck + +click-left = $HOME/bin/nightmodetoggle click +click-middle = $HOME/bin/nightmodetoggle click +click-right = $HOME/bin/nightmodetoggle click + +double-click-left = $HOME/bin/nightmodetoggle disable +double-click-middle = $HOME/bin/nightmodetoggle disable +double-click-right = $HOME/bin/nightmodetoggle disable + + [module/cpu] type = internal/cpu interval = 2 format-prefix = "CPU " -format-prefix-foreground = ${colors.foreground-alt} -format-underline = ${colors.primary} label = %percentage:2%% [module/memory] type = internal/memory interval = 2 format-prefix = "RAM " -format-prefix-foreground = ${colors.foreground-alt} -format-underline = ${colors.primary} label = %percentage_used%% [module/wlan] @@ -282,43 +343,50 @@ type = internal/network interface = wlo1 interval = 3.0 -format-connected = <label-connected> -label-connected =  %essid% %local_ip% +format-connected =  <label-connected> +label-connected = %essid% %local_ip% +format-connected-foreground = ${root.primary} +;label-connected-foreground = #fff + +format-disconnected-prefix =  +label-disconnected = " disconnected" +format-disconnected-prefix-foreground = ${root.primary} +;label-disconnected-foreground = ${bar.foreground} -format-disconnected = <label-disconnected> -;format-disconnected-underline = ${self.format-connected-underline} -label-disconnected =  disconnected ramp-signal-0 =  ramp-signal-1 =  ramp-signal-2 =  ramp-signal-3 =  ramp-signal-4 =  -ramp-signal-foreground = ${colors.primary} +ramp-signal-foreground = ${root.primary} + +[module/vpn] +type = custom/script +exec = $HOME/bin/checkforvpn + +click-left = $HOME/bin/vpnswitch +click-right = $HOME/bin/vpnswitch +click-middle = $HOME/bin/vpnswitch [module/eth] type = internal/network interface = eno1 interval = 3.0 -format-connected-underline = ${colors.primary} +format-connected-underline = ${root.primary} format-connected-prefix =  -format-connected-prefix-foreground = ${colors.primary} +format-connected-prefix-foreground = ${root.primary} label-connected = %local_ip% -label-connected-foreground = ${colors.foreground-alt} format-disconnected = -;format-disconnected = <label-disconnected> -;format-disconnected-underline = ${self.format-connected-underline} -;label-disconnected = %ifname% disconnected -;label-disconnected-foreground = ${colors.foreground-alt} [module/time] type = internal/date interval = 1 date = " %A" -date-alt =" %e/%B/%Y" +date-alt =" %e %B %Y" time = " %H:%M" time-alt = " %H:%M:%S" @@ -330,15 +398,14 @@ type = internal/pulseaudio format-volume = <ramp-volume> <label-volume> label-volume = %percentage%% -label-volume-foreground = ${colors.foreground} ramp-volume-0 =  ramp-volume-1 =  ramp-volume-2 =  -ramp-volume-foreground = ${colors.primary} +ramp-volume-foreground = ${root.primary} label-muted =  -label-muted-foreground = ${colors.primary} +label-muted-foreground = ${root.primary} [module/backlight] type = internal/backlight @@ -351,7 +418,7 @@ ramp-3 =  ramp-2 =  ramp-1 =  ramp-0 =  -ramp-foreground = ${colors.primary} +ramp-foreground = ${root.primary} [module/battery] type = internal/battery @@ -360,26 +427,26 @@ adapter = ADP1 full-at = 98 format-charging =  <label-charging> -format-charging-underline = ${colors.primary} +format-charging-underline = ${root.primary} format-discharging = <ramp-capacity> <label-discharging> format-full-prefix = " " -format-full-prefix-foreground = ${colors.primary} -format-full-underline = ${colors.primary} +format-full-prefix-foreground = ${root.primary} +format-full-underline = ${root.primary} ramp-capacity-0 =  ramp-capacity-1 =  ramp-capacity-2 =  ramp-capacity-3 =  -ramp-capacity-3-foreground = ${colors.primary} +ramp-capacity-3-foreground = ${root.primary} ramp-capacity-1-foreground = #ffaa00 ramp-capacity-0-foreground = #ff383b animation-charging-0 =  animation-charging-1 =  animation-charging-2 =  -animation-charging-foreground = ${colors.primary} +animation-charging-foreground = ${root.primary} animation-charging-framerate = 750 animation-discharging-0 =  @@ -397,11 +464,11 @@ format-spacing = 1 label-open =  label-open-font = 4 -label-open-foreground = ${colors.primary} +label-open-foreground = ${root.power} label-close = Cancel -label-close-foreground = ${colors.primary} +label-close-foreground = ${root.power} label-separator = | -label-separator-foreground = ${colors.foreground-alt} +label-separator-foreground = ${root.foreground} menu-0-0 = Reboot menu-0-0-exec = menu-open-1 diff --git a/.config/terminator/config b/.config/terminator/config @@ -1,5 +1,6 @@ [global_config] [keybindings] + next_profile = <Primary><Shift>p [layouts] [[default]] [[[child1]]] @@ -12,7 +13,7 @@ [plugins] [profiles] [[default]] - background_darkness = 0.72 + background_darkness = 0.76 background_type = transparent cursor_color = "#aaaaaa" scrollback_infinite = True diff --git a/.fehbg b/.fehbg @@ -1,2 +0,0 @@ -#!/bin/sh -feh --bg-fill '/home/cem/Pictures/Wallpapers/ben-klea-1518594-unsplash.jpg' diff --git a/bin/checkforvpn b/bin/checkforvpn @@ -0,0 +1,8 @@ +#!/usr/bin/python + +import os + +if 'tun0' in os.popen('ip a').read(): + print('Connected ') +else: + print('') diff --git a/bin/nightmodecheck b/bin/nightmodecheck @@ -0,0 +1,30 @@ +#!/bin/sh + +if [ -e $HOME/.night ] +then + if [ $(head -n +1 $HOME/.night) = "CLICK=1" ] + then + CLICK="Overriden" + else + CLICK="0" + fi + if [ $(tail -n -1 $HOME/.night) = "NIGHT=0" ] + then + if [ $CLICK = "0" ] + then + echo "" + else + echo " $CLICK" + fi + elif [ $(tail -n -1 $HOME/.night) = "NIGHT=1" ] + then + if [ $CLICK = "0" ] + then + echo "" + else + echo " $CLICK" + fi + fi +else + echo There is a problem +fi diff --git a/bin/nightmodetoggle b/bin/nightmodetoggle @@ -0,0 +1,62 @@ +#!/bin/sh + +if [ -e $HOME/.night ] +then + case $1 in + "click") + NIGHT=$(tail -n -1 $HOME/.night) + if [ $NIGHT = 'NIGHT=1' ] + then + NIGHT='NIGHT=0' + else + NIGHT='NIGHT=1' + fi + echo 'CLICK=1' > $HOME/.night + echo $NIGHT >> $HOME/.night + ;; + "disable") + NIGHT=$(tail -n -1 $HOME/.night) + echo 'CLICK=0' > $HOME/.night + echo $NIGHT >> $HOME/.night + nightmodetoggle cron + ;; + "cron") + if [ $(head -n +1 $HOME/.night) = "CLICK=1" ] + then + exit + else + if [ `date +%H%M` -gt "1859" ] || [ `date +%H%M` -lt "0600" ] + then + echo $'CLICK=0\nNIGHT=1' > $HOME/.night + else + echo $'CLICK=0\nNIGHT=0' > $HOME/.night + fi + fi + ;; + *) + echo $'Please enter an argument!\ne.g.\nclick\ndisable\ncron' + exit + ;; + esac + if [ $(tail -n -1 $HOME/.night) = "NIGHT=1" ] + then + feh --bg-fill --randomize $HOME/Pictures/Wallpapers/Night/* + if [[ $(ps aux | grep -i polybar) == *night* ]] + then + exit + else + $HOME/bin/polyrestart night + fi + else + feh --bg-fill --randomize $HOME/Pictures/Wallpapers/Morning/* + if [[ $(ps aux | grep -i polybar | head -n +1 -) == *"polybar -q top" ]] + then + exit + else + $HOME/bin/polyrestart morning + fi + fi +else + touch $HOME/.night + echo $'CLICK=0\nNIGHT=0' > $HOME/.night +fi diff --git a/bin/polyrestart b/bin/polyrestart @@ -1,7 +1,33 @@ #!/bin/sh -kill $(pidof polybar) +if [[ $(ps aux) == *polybar* ]] +then + kill $(pidof polybar) +fi sleep 0.5 -polybar -q top &>/dev/null & -sleep 0.5 -polybar -q bottom &>/dev/null & +case $1 in + morning) + polybar -q top &>/dev/null & + sleep 0.5 + polybar -q bottom &>/dev/null & + ;; + night) + polybar -q topnight &>/dev/null & + sleep 0.5 + polybar -q bottomnight &>/dev/null & + ;; + *) + if [ -e $HOME/.night ] + then + if [ $(tail -n -1 $HOME/.night) = "NIGHT=1" ] + then + $HOME/bin/polyrestart night + elif [ $(tail -n -1 $HOME/.night) = "NIGHT=0" ] + then + $HOME/bin/polyrestart morning + else + echo Unexpected error + fi + fi + ;; +esac diff --git a/bin/testt b/bin/testt @@ -0,0 +1,50 @@ +#!/bin/sh + +if [ -e $HOME/.night ] +then + case $1 in + "click") + NIGHT=$(tail -n -1 $HOME/.night) + if [ $NIGHT = 'NIGHT=1' ] + then + NIGHT='NIGHT=0' + else + NIGHT='NIGHT=1' + fi + echo 'CLICK=1' > $HOME/.night + echo $NIGHT >> $HOME/.night + ;; + "disable") + NIGHT=$(tail -n -1 $HOME/.night) + echo 'CLICK=0' > $HOME/.night + echo $NIGHT >> $HOME/.night + nightmodetoggle cron + ;; + "cron") + if [ $(head -n +1 $HOME/.night) = "CLICK=1" ] + then + exit + else + if [ `date +%H%M` -gt "1900" ] || [ `date +%H%M` -lt "0600" ] + then + echo $'CLICK=0\nNIGHT=1' > $HOME/.night + else + echo $'CLICK=0\nNIGHT=0' > $HOME/.night + fi + fi + ;; + *) + echo $'Please enter an argument!\ne.g.\nclick\ndisable\ncron' + exit + ;; + esac + if [ $(tail -n -1 $HOME/.night) = "NIGHT=1" ] + then + feh --bg-fill --randomize $HOME/Pictures/Wallpapers/Night/* + else + feh --bg-fill --randomize $HOME/Pictures/Wallpapers/Morning/* + fi +else + touch $HOME/.night + echo $'CLICK=0\nNIGHT=0' > $HOME/.night +fi diff --git a/bin/vpnswitch b/bin/vpnswitch @@ -0,0 +1,9 @@ +#!/bin/sh + +if [[ $(ip a) == *tun0* ]] +then + zensu kill $(pidof openvpn) +else + zensu openvpn --config $VPNCONFIG & +fi + diff --git a/bin/wallset b/bin/wallset @@ -1,10 +1,17 @@ #!/bin/sh # Dmenu Script to change wallpaper -export selection=$(ls $HOME/Pictures/Wallpapers | grep -i .jpg | dmenu) +if [ $(tail -n -1 $HOME/.night) = "NIGHT=1" ] +then + export nightmode="Night" +else + export nightmode="Morning" +fi +export selection=$(ls $HOME/Pictures/Wallpapers/$nightmode | grep -i .jpg | dmenu) if [$selection = ""] then exit else - feh --bg-fill $HOME/Pictures/Wallpapers/$selection + feh --bg-fill $HOME/Pictures/Wallpapers/$nightmode/$selection + notify-send 'New wallpaper' 'Your wallpaper has been changed !' fi diff --git a/bin/yousure b/bin/yousure @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ $(echo $'No\nYes' | dmenu -p 'Are you sure you want to shutdown?') = 'Yes' ] +then + shutdown -P now +else + exit +fi diff --git a/bin/yousurereb b/bin/yousurereb @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ $(echo $'No\nYes' | dmenu -p 'Are you sure you want to reboot?') = 'Yes' ] +then + reboot +else + exit +fi