From aa1fbe12aec99cecd90f2e7ea21d8ab2110ac4ba Mon Sep 17 00:00:00 2001 From: Shubham Saini Date: Sat, 1 Aug 2020 15:57:02 +0530 Subject: added lemon --- bin/.local/bin/bdown | 1 - bin/.local/bin/bup | 1 - bin/.local/bin/passmenu | 5 -- bspwm/.config/bspwm/bspwmrc | 30 +++++++++--- compton/.config/compton.conf | 75 ------------------------------ lemonbar/launch | 5 ++ lemonbar/lime | 74 ++++++++++++++++++++++++++++++ picom/.config/picom.conf | 7 ++- sxhkd/.config/sxhkd/sxhkdrc | 106 +++++++++++-------------------------------- x/.xinitrc | 12 +---- zsh/.zshrc | 3 +- 11 files changed, 137 insertions(+), 182 deletions(-) delete mode 100755 bin/.local/bin/bdown delete mode 100755 bin/.local/bin/bup delete mode 100755 bin/.local/bin/passmenu delete mode 100644 compton/.config/compton.conf create mode 100755 lemonbar/launch create mode 100755 lemonbar/lime diff --git a/bin/.local/bin/bdown b/bin/.local/bin/bdown deleted file mode 100755 index 253666c..0000000 --- a/bin/.local/bin/bdown +++ /dev/null @@ -1 +0,0 @@ -for f in /sys/class/backlight/*; do echo $(($(<$f/brightness)-5*$(<$f/max_brightness)/100)) > $f/brightness; done diff --git a/bin/.local/bin/bup b/bin/.local/bin/bup deleted file mode 100755 index d7c55c3..0000000 --- a/bin/.local/bin/bup +++ /dev/null @@ -1 +0,0 @@ -for f in /sys/class/backlight/*; do echo $(($(<$f/brightness)+5*$(<$f/max_brightness)/100)) > $f/brightness; done diff --git a/bin/.local/bin/passmenu b/bin/.local/bin/passmenu deleted file mode 100755 index 1d22303..0000000 --- a/bin/.local/bin/passmenu +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -password=$(find ~/.password-store/ -type f -name '*.gpg' | - sed 's/.*\/\(.*\)\.gpg$/\1/' | dmenu -l 5 -p "Pass:") -[ -n "$password" ] && st -e pass -c "$password" diff --git a/bspwm/.config/bspwm/bspwmrc b/bspwm/.config/bspwm/bspwmrc index 472e32e..0eff3f8 100755 --- a/bspwm/.config/bspwm/bspwmrc +++ b/bspwm/.config/bspwm/bspwmrc @@ -1,16 +1,32 @@ -#! /bin/sh - -sxhkd & - -bspc monitor -d term web music files code virt chat game IX X +#!/bin/bash +# bspwm +bspc monitor -d 1 2 3 4 5 6 bspc config border_width 0 bspc config window_gap 8 -bspc config focus_follows_pointer true bspc config split_ratio 0.50 +bspc config focus_follows_pointer true bspc config borderless_monocle true bspc config gapless_monocle true +# rules bspc rule -a Chromium desktop='^2' +bspc rule -a Steam desktop='^6' + +# scratchpad +bspc rule -a scratchpad sticky=on state=floating hidden=on +[ "$(ps -x | grep -c 'scratchpad')" -eq "1" ] && st -c scratchpad -e ~/bin/scratch & -~/bartest | lemonbar -F "#000000" & +# autostart +xrdb -merge ~/.Xresources & +xsetroot -cursor_name left_ptr & +sxhkd & +xss-lock -- slock & +xset b off & +xset s 300 & +~/.fehbg & +urxvtd & +~/.local/bin/bat_check.sh & +picom & +dunst & +~/bin/panel diff --git a/compton/.config/compton.conf b/compton/.config/compton.conf deleted file mode 100644 index 6c99fcc..0000000 --- a/compton/.config/compton.conf +++ /dev/null @@ -1,75 +0,0 @@ -## SHADOWS -shadow = true; -shadow-radius = 0.5; -shadow-offset-x = 3; -shadow-offset-y = 3; -shadow-opacity = 0.65; -log-level = "warn"; -shadow-exclude = [ - "name = 'Notification'", - "class_g = 'conky'", - "class_g ?= 'Notify-osd'", - "class_g = 'Cairo-clock'", - "class_g ?= 'slop'", - "name = 'polybar'", - "name = 'Polybar tray window'", - "class_g ?= 'Rofi'", - "class_g ?= 'dwm'", - "class_g = 'Firefox' && argb", - "_GTK_FRAME_EXTENTS@:c" -]; - -## OPACITY -frame-opacity = 1.0; -inactive-opacity-override = false; -blur-background = true; -blur-strength = 3; -blur-kern = "3x3box"; -blur-background-exclude = [ - "class_g ?= 'slop'", - "name = 'polybar'", - "name = 'Polybar tray window'", - "class_g = 'conky'", - "class_g ?= 'Rofi'", - "class_g ?= 'zoom'" -]; -opacity-rule = [ - "40:class_g = 'Bspwm' && class_i = 'presel_feedback'", - "100:class_g = 'URxvt' && focused", - "95:class_g = 'URxvt' && !focused" -]; - -## FADING -fading = true; -fade-in-step = 0.03; -fade-out-step = 0.03; -fade-exclude = [ ]; - -## GLX -glx-no-stencil = true; -glx-no-rebind-pixmap = true; -use-damage = true; - -## WINDOW TYPES -wintypes: -{ - tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; }; - dock = { shadow = false; } - dnd = { shadow = false; } - popup_menu = { opacity = 0.8; } - dropdown_menu = { opacity = 0.8; } -}; - -## MISC -backend = "glx"; -mark-wmwin-focused = true; -mark-ovredir-focused = true; -use-ewmh-active-win = true; -detect-rounded-corners = true; -detect-client-opacity = true; -refresh-rate = 0; -vsync = true; -focus-exclude = [ "class_g = 'Cairo-clock'" ]; -detect-transient = true; -detect-client-leader = true; -invert-color-include = [ ]; diff --git a/lemonbar/launch b/lemonbar/launch new file mode 100755 index 0000000..981c88f --- /dev/null +++ b/lemonbar/launch @@ -0,0 +1,5 @@ +#!/bin/bash +# Launches an instance of lemonbar +killall -q lime lemonbar + +~/.config/lemonbar/lime | lemonbar -p -F "#2f2f2f" -f "JetBrains Mono Nerd Font Mono:style=medium:pixelsize=12.5:antialias=true:autohint=true:lcdfilter=lcddefault:rgba=rgb" diff --git a/lemonbar/lime b/lemonbar/lime new file mode 100755 index 0000000..e2ce156 --- /dev/null +++ b/lemonbar/lime @@ -0,0 +1,74 @@ +#!/bin/bash +# Outputs a configuration for lemonbar + +vol(){ + vol=$(pulsemixer --get-volume | awk '{print $1}') + mute=$(pulsemixer --get-mute) + if [ "$mute" == 1 ]; then + echo -e "%{F#787878}vol%{F-} muted " + elif [ "$mute" == 0 ]; then + echo -e "%{F#787878}vol%{F-} $vol% " + fi +} + +bat() { + power=$(cat /sys/class/power_supply/BAT0/capacity) + status=$(cat /sys/class/power_supply/BAT0/status) + if [ "$status" == "Charging" ]; then + echo -e "%{F#787878}bat%{F-} +$power% " + elif [ "$status" == "Discharging" ]; then + echo -e "%{F#787878}bat%{F-} $power% " + fi +} + +dte() { + dte=$(date +"%a, %b %d") + echo -e "%{F#787878}date%{F-} $dte " +} + +tie() { + tme=$(date +"%I:%M %P") + echo -e "%{F#787878}time%{F-} $tme " +} + +groups() { + cur=`xprop -root _NET_CURRENT_DESKTOP | awk '{print $3}'` + tot=`xprop -root _NET_NUMBER_OF_DESKTOPS | awk '{print $3}'` + + for w in `seq 0 $((cur - 1))`; do line="${line}  "; done + line="${line}  " + for w in `seq $((cur + 2)) $tot`; do line="${line}  "; done + echo $line +} + +workspaces() { + all=$(bspc query -D) + occupied=$(bspc query -D -d .occupied) + current=$(bspc query -D -d .focused) + result="" + padding=" " + while IFS= read -r line; do + # Get the name of the current desktop + name="" + if [[ "$occupied" == *"$line"* ]]; + then + name="" + fi + + if [[ "$current" == *"$line"* ]]; + then + name="" + fi + + result="$result$padding" + result="$result$name" + result="$result$padding" + done <<< "$all" + echo -e "$result" +} + +while true; do + echo " $(vol) $(bat) $(tie) $(dte) %{F#787878}$(workspaces)%{F-}" + xdo above -t $(xdo id -n root) $(xdo id -n lemonbar) + sleep 3 +done diff --git a/picom/.config/picom.conf b/picom/.config/picom.conf index eb647e8..9b4579a 100644 --- a/picom/.config/picom.conf +++ b/picom/.config/picom.conf @@ -6,6 +6,7 @@ shadow-offset-y = -12; shadow-exclude = [ "name = 'Notification'", "class_g ?= 'Notify-osd'", + "class_g ?= 'dmenu'", "name = 'polybar'", "name = 'Polybar tray window'", "class_g ?= 'dwm'", @@ -20,6 +21,7 @@ inactive-opacity-override = false; blur-background = true; blur-strength = 3; blur-kern = "3x3box"; +# blur-method = "dual_kawase"; blur-background-exclude = [ "name = 'polybar'", "name = 'Polybar tray window'", @@ -69,4 +71,7 @@ detect-transient = true; detect-client-leader = true; invert-color-include = [ ]; corner-radius = 5; -rounded-corners-exclude = [ "name = 'bar'" ] +rounded-corners-exclude = [ + "name = 'bar'", + "class_g ?= 'dmenu'", +]; diff --git a/sxhkd/.config/sxhkd/sxhkdrc b/sxhkd/.config/sxhkd/sxhkdrc index 2db257e..38b99a4 100644 --- a/sxhkd/.config/sxhkd/sxhkdrc +++ b/sxhkd/.config/sxhkd/sxhkdrc @@ -1,165 +1,111 @@ -# wm independent hotkeys -## terminal emulator super + Return urxvtc super + shift + Return bspc rule -a \* -o state=floating && urxvtc - -# program launcher super + @space - dmenu_run -l 10 -super + c - rofi -show calc -modi calc -no-show-match -no-sort -no-history -super + i - ~/.config/rofi/rofi-wifi.sh - -# cmus (I don't know why mpDris is not supported. Got it musl problem lol) -super + {u,n} - cmus-remote {-p,-n} -super + shift + {u,n} - cmus-remote {-u,-r} - - -# make sxhkd reload its configuration files: -super + Escape - pkill -USR1 -x sxhkd - -# -# bspwm hotkeys + dmenu_run -i -fn "JetBrains Mono Nerd Font Mono:style=medium:pixelsize=12.5" -nb "#f3f4f5" -nf "#2f2f2f" -sb "#626868" -sf "#ffffff" super + shift + w - firefox + chromium control + alt + l xset s activate super + shift + f - spacefm + urxvtc -e ranger Print - scrot -u + screenshot f +control + Print + screenshot w super + x /home/fd0e/.local/bin/shut super + shift + p /home/fd0e/.local/bin/passmenu -# +super + Escape + pkill -USR1 -x sxhkd + +# volume +XF86Audio{RaiseVolume,LowerVolume} + pulsemixer --change-volume {+5,-5} +XF86AudioMute + pulsemixer --toggle-mute + +# cmus +XF86Audio{Play,Next,Prev} + cmus-remote {-u,-n,-r} + +# brightness +XF86MonBrightnessDown + sudo ~/bin/light d +XF86MonBrightnessUp + sudo ~/bin/light u + +# bspwm hotkeys # quit/restart bspwm super + alt + {q,r} bspc {quit,wm -r} - # close and kill super + {_,shift + }w bspc node -{c,k} - # alternate between the tiled and monocle layout super + m bspc desktop -l next - # send the newest marked node to the newest preselected node super + y bspc node newest.marked.local -n newest.!automatic.local - # swap the current node and the biggest node super + g bspc node -s biggest - -# -# state/flags -# - # set the window state super + {t,shift + t,s,f} bspc node -t {tiled,pseudo_tiled,floating,fullscreen} - # set the node flags super + ctrl + {m,x,y,z} bspc node -g {marked,locked,sticky,private} - -# -# focus/swap -# - # focus the node in the given direction super + {_,shift + }{h,j,k,l} bspc node -{f,s} {west,south,north,east} - # focus the node for the given path jump super + {p,b,comma,period} bspc node -f @{parent,brother,first,second} - # focus the next/previous node in the current desktop alt + {_,shift + }Tab bspc node -f {next,prev}.local - # focus the next/previous desktop in the current monitor super + bracket{left,right} bspc desktop -f {prev,next}.local - # focus the last node/desktop super + {grave,Tab} bspc {node,desktop} -f last - # focus the older or newer node in the focus history super + {o,i} bspc wm -h off; \ bspc node {older,newer} -f; \ bspc wm -h on - # focus or send to the given desktop super + {_,shift + }{1-9,0} bspc {desktop -f,node -d} '^{1-9,10}' - -# -# preselect -# - #remove gaps super + minus bspc config window_gap 0 super + equal bspc config window_gap 8 - # preselect the direction super + ctrl + {h,j,k,l} bspc node -p {west,south,north,east} - # preselect the ratio super + ctrl + {1-9} bspc node -o 0.{1-9} - # cancel the preselection for the focused node super + ctrl + space bspc node -p cancel - # cancel the preselection for the focused desktop super + ctrl + shift + space bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel - -# -# move/resize -# - # expand a window by moving one of its side outward super + alt + {h,j,k,l} bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0} - # contract a window by moving one of its side inward super + alt + shift + {h,j,k,l} bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0} - # move a floating window super + {Left,Down,Up,Right} bspc node -v {-20 0,0 20,0 -20,20 0} - -#Volume -XF86Audio{RaiseVolume,LowerVolume} - pulsemixer --change-volume {+5,-5} -XF86AudioMute - pulsemixer --toggle-mute - -#Playerctl -XF86Audio{Play,Next,Prev} - cmus-remote {-u,-n,-r} - -#light -XF86MonBrightnessDown - sudo ~/bin/light d -XF86MonBrightnessUp - sudo ~/bin/light u diff --git a/x/.xinitrc b/x/.xinitrc index e463e18..7cc89b1 100644 --- a/x/.xinitrc +++ b/x/.xinitrc @@ -1,17 +1,7 @@ #!/bin/bash -#.xinitrc -/usr/bin/prime-offload & -xrdb -merge ~/.Xresources & -xss-lock -- slock & -xset b off & -xset s 300 & +#/usr/bin/prime-offload & setxkbmap -layout us -option caps:ctrl_modifier & xcape -e 'Caps_Lock=Escape' & # xrandr --setprovideroutputsource modesetting NVIDIA-0 # xrandr --auto -~/.fehbg & -urxvtd & -~/.local/bin/bat_check.sh & -picom & -dunst & exec bspwm diff --git a/zsh/.zshrc b/zsh/.zshrc index c1e5c28..ebc4f94 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -9,7 +9,8 @@ export VISUAL=nvim export EDITOR="$VISUAL" export BROWSER=firefox export PATH=$PATH:$HOME/.local/bin:$HOME/bin -export XDG_CURRENT_DESKTOP=spectrwm +export TERM=rxvt-unicode-256color +export XDG_CURRENT_DESKTOP=bspwm #aliases alias ls='ls --color=auto' -- cgit v1.2.3