GitLab system status is available here and here

Commit 7ed3a4ee authored by Kabir Kwatra's avatar Kabir Kwatra
Browse files

feat: initial commit

parents
#!/bin/sh
pgrep -x sxhkd > /dev/null || sxhkd &
bspc monitor -d I II III IV V VI VII VIII IX X
bspc config border_width 2
bspc config window_gap 2
bspc config split_ratio 1.61803398875 #0.52
bspc config borderless_monocle true
bspc config gapless_monocle true
bspc config pointer_follows_focus true
bspc config focus_follows_pointer true
# Border
bspc config focused_border_color "#6c71c4"
bspc config normal_border_color "#073642"
bspc config active_border_color "#073642"
# Per Application Default Layout
bspc rule -a Emacs state=tiled
#
# Autostart
#
# Set display from arandr saved script
sh ~/.screenlayout/monitor.sh &
# Bar
~/.config/polybar/launch.sh &
# Notifications
dunst &
# Polkit
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
# Wallpaper
nitrogen --restore &
# Dex
dex -a -s /etc/xdg/autostart/:~/.config/autostart/
# Picom
picom -CGb &
# Network Applet
nm-applet --indicator &
# Blueman Applet
blueman-applet &
# Cursor
xsetroot -cursor_name left_ptr &
# Low battery notifier
~/.config/bspwm/scripts/low_bat_notifier.sh
#!/usr/bin/env bash
# Author: Dolores Portalatin <hello@doloresportalatin.info>
# Dependencies: imagemagick, i3lock-color-git, scrot, wmctrl (optional)
# Aquired from https://github.com/meskarune/i3lock-fancy
# Modified for use
set -o errexit -o noclobber -o nounset
hue=(-level "0%,100%,0.6")
effect=(-filter Gaussian -resize 20% -define "filter:sigma=1.5" -resize 500.5%)
# default system sans-serif font
font=$(convert -list font | awk "{ a[NR] = \$2 } /family: $(fc-match sans -f "%{family}\n")/ { print a[NR-1]; exit }")
image=$(mktemp --suffix=.png)
shot=(import -window root)
desktop=""
i3lock_cmd=(i3lock -i "$image")
shot_custom=false
options="Options:
-h, --help This help menu.
-d, --desktop Attempt to minimize all windows before locking.
-g, --greyscale Set background to greyscale instead of color.
-p, --pixelate Pixelate the background instead of blur, runs faster.
-f <fontname>, --font <fontname> Set a custom font.
-t <text>, --text <text> Set a custom text prompt.
-l, --listfonts Display a list of possible fonts for use with -f/--font.
Note: this option will not lock the screen, it displays
the list and exits immediately.
-n, --nofork Do not fork i3lock after starting.
-- Must be last option. Set command to use for taking a
screenshot. Default is 'import -window root'. Using 'scrot'
or 'maim' will increase script speed and allow setting
custom flags like having a delay."
# move pipefail down as for some reason "convert -list font" returns 1
set -o pipefail
trap 'rm -f "$image"' EXIT
temp="$(getopt -o :hdnpglt:f: -l desktop,help,listfonts,nofork,pixelate,greyscale,text:,font: --name "$0" -- "$@")"
eval set -- "$temp"
# l10n support
text="Type password to unlock"
case "${LANG:-}" in
af_* ) text="Tik wagwoord om te ontsluit" ;; # Afrikaans
de_* ) text="Bitte Passwort eingeben" ;; # Deutsch
da_* ) text="Indtast adgangskode" ;; # Danish
en_* ) text="Type password to unlock" ;; # English
es_* ) text="Ingrese su contraseña" ;; # Española
fr_* ) text="Entrez votre mot de passe" ;; # Français
he_* ) text="הליענה לטבל המסיס דלקה" ;; # Hebrew עברית (convert doesn't play bidi well)
hi_* ) text="अनलॉक करने के लिए पासवर्ड टाईप करें" ;; #Hindi
id_* ) text="Masukkan kata sandi Anda" ;; # Bahasa Indonesia
it_* ) text="Inserisci la password" ;; # Italian
ja_* ) text="パスワードを入力してください" ;; # Japanese
lv_* ) text="Ievadi paroli" ;; # Latvian
nb_* ) text="Skriv inn passord" ;; # Norwegian
pl_* ) text="Podaj hasło" ;; # Polish
pt_* ) text="Digite a senha para desbloquear" ;; # Português
tr_* ) text="Giriş yapmak için şifrenizi girin" ;; # Turkish
ru_* ) text="Введите пароль" ;; # Russian
* ) text="Type password to unlock" ;; # Default to English
esac
while true ; do
case "$1" in
-h|--help)
printf "Usage: %s [options]\n\n%s\n\n" "${0##*/}" "$options"; exit 1 ;;
-d|--desktop) desktop=$(command -V wmctrl) ; shift ;;
-g|--greyscale) hue=(-level "0%,100%,0.6" -set colorspace Gray -average) ; shift ;;
-p|--pixelate) effect=(-scale 10% -scale 1000%) ; shift ;;
-f|--font)
case "$2" in
"") shift 2 ;;
*) font=$2 ; shift 2 ;;
esac ;;
-t|--text) text=$2 ; shift 2 ;;
-l|--listfonts)
convert -list font | awk -F: '/Font: / { print $2 }' | sort -du | command -- ${PAGER:-less}
exit 0 ;;
-n|--nofork) i3lock_cmd+=(--nofork) ; shift ;;
--) shift; shot_custom=true; break ;;
*) echo "error" ; exit 1 ;;
esac
done
if "$shot_custom" && [[ $# -gt 0 ]]; then
shot=("$@");
fi
command -- "${shot[@]}" "$image"
value="60" #brightness value to compare to
color=$(convert "$image" -gravity center -crop 100x100+0+0 +repage -colorspace hsb \
-resize 1x1 txt:- | awk -F '[%$]' 'NR==2{gsub(",",""); printf "%.0f\n", $(NF-1)}');
if [[ $color -gt $value ]]; then #white background image and black text
bw="black"
icon="/home/$USER/.config/bspwm/scripts/i3lock-fancy/circlelockdark.png"
param=("--insidecolor=0000001c" "--ringcolor=0000003e" \
"--linecolor=00000000" "--keyhlcolor=ffffff80" "--ringvercolor=ffffff00" \
"--separatorcolor=22222260" "--insidevercolor=ffffff1c" \
"--ringwrongcolor=ffffff55" "--insidewrongcolor=ffffff1c" \
"--verifcolor=ffffff00" "--wrongcolor=ff000000" "--timecolor=ffffff00" \
"--datecolor=ffffff00" "--layoutcolor=ffffff00")
else #black
bw="white"
icon="/home/$USER/.config/bspwm/scripts/i3lock-fancy/circlelock.png"
param=("--insidecolor=ffffff1c" "--ringcolor=ffffff3e" \
"--linecolor=ffffff00" "--keyhlcolor=00000080" "--ringvercolor=00000000" \
"--separatorcolor=22222260" "--insidevercolor=0000001c" \
"--ringwrongcolor=00000055" "--insidewrongcolor=0000001c" \
"--verifcolor=00000000" "--wrongcolor=ff000000" "--timecolor=00000000" \
"--datecolor=00000000" "--layoutcolor=00000000")
fi
convert "$image" "${hue[@]}" "${effect[@]}" -font "$font" -pointsize 26 -fill "$bw" -gravity center \
-annotate +0+160 "$text" "$icon" -gravity center -composite "$image"
# If invoked with -d/--desktop, we'll attempt to minimize all windows (ie. show
# the desktop) before locking.
${desktop} ${desktop:+-k on}
# try to use i3lock with prepared parameters
if ! "${i3lock_cmd[@]}" "${param[@]}" >/dev/null 2>&1; then
# We have failed, lets get back to stock one
"${i3lock_cmd[@]}"
fi
# As above, if we were passed -d/--desktop, we'll attempt to restore all windows
# after unlocking.
${desktop} ${desktop:+-k off}
#!/usr/bin/env bash
awk '/^[a-z]/ &&
last {print "<small>",$0,"\t",last,"</small>"}
{last=""}
/^#/{last=$0}' \
~/.config/sxhkd/sxhkdrc |
column -t -s $'\t' |
rofi \
-dmenu \
-i \
-p "keybindings:" \
-markup-rows \
-no-show-icons \
-width 1000 \
-lines 15 \
-yoffset 40
#!/bin/bash
### VARIABLES
POLL_INTERVAL=60 # seconds at which to check battery level
LOW_BAT=33 # lesser than this is considered low battery
# If BAT0 doesn't work for you, check available devices with command below
#
# $ ls -1 /sys/class/power_supply/
#
BAT_PATH=/sys/class/power_supply/BAT0
BAT_STAT=$BAT_PATH/status
if [[ -f $BAT_PATH/charge_full ]]
then
BAT_FULL=$BAT_PATH/charge_full
BAT_NOW=$BAT_PATH/charge_now
elif [[ -f $BAT_PATH/energy_full ]]
then
BAT_FULL=$BAT_PATH/energy_full
BAT_NOW=$BAT_PATH/energy_now
else
exit
fi
### END OF VARIABLES
kill_running() { # stop older instances to not get multiple notifications
local mypid=$$
declare pids=($(pgrep -f ${0##*/}))
for pid in ${pids[@]/$mypid/}; do
kill $pid
sleep 1
done
}
# Run only if battery is detected
if ls -1qA /sys/class/power_supply/ | grep -q .
then
kill_running
while true
do
bf=$(cat $BAT_FULL)
bn=$(cat $BAT_NOW)
bs=$(cat $BAT_STAT)
bat_percent=$(( 100 * $bn / $bf ))
if [[ $bat_percent -lt $LOW_BAT && "$bs" = "Discharging" ]]
then
notify-send --urgency=critical "$bat_percent% : Low Battery!"
fi
sleep $POLL_INTERVAL
done
fi
#!/bin/bash
# options to be displayed
option0="screen"
option1="area"
option2="window"
# options to be displyed
options="$option0\n$option1\n$option2"
selected="$(echo -e "$options" | rofi -lines 3 -dmenu -p "scrot")"
case $selected in
$option0)
cd ~/Pictures/ && sleep 1 && scrot;;
$option1)
cd ~/Pictures/ && scrot -s;;
$option2)
cd ~/Pictures/ && sleep 1 && scrot -u;;
esac
#
# wm independent hotkeys
#
# terminal emulator
super + Return
kitty #xfce4-terminal
# program launcher
super + r
rofi -modi drun -show drun -line-padding 4 \
-columns 2 -padding 50 -hide-scrollbar -terminal xfce4-terminal \
-show-icons -drun-icon-theme "Arc-X-D" -font "Droid Sans Regular 10"
# show open window
super + ctrl + d
rofi -modi drun -show window -line-padding 4 \
-columns 2 -padding 50 -hide-scrollbar -terminal xfce4-terminal \
-show-icons -drun-icon-theme "Arc-X-D" -font "Droid Sans Regular 10"
# show ssh sesssions
super + shift + d
rofi -modi drun -show ssh -line-padding 4 \
-columns 2 -padding 50 -hide-scrollbar -terminal xfce4-terminal \
-show-icons -drun-icon-theme "Arc-X-D" -font "Droid Sans Regular 10"
# power-menu
super + shift + e
~/.config/rofi/powermenu.sh
# make sxhkd reload its configuration files:
super + Escape
pkill -USR1 -x sxhkd
#
# bspwm hotkeys
#
# quit/restart bspwm
super + alt + {q,r}
bspc {quit,wm -r}
# close and kill
super + {_,shift + }q
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 window
super + g
bspc node -s biggest.local # window
#
# 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 window in the current desktop
super + {_,shift + }c
bspc node -f {next,prev}.local.!hidden.window
# 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
#
# 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
# select parent, left, or right child of the focused node
super + ctrl + shift + {h,k,l}
bspc node -f @{first,parent,second}
# rotate focused node
super + ctrl + shift + space
bspc node -R 90
#
# 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}
#
# Special hotkeys
#
# Multimedia keys
XF86AudioRaiseVolume
amixer -q set Master 5%+ unmute
# Still muøltimedia
XF86AudioLowerVolume
amixer -q set Master 5%- unmute
# still
XF86AudioMute
amixer -D pulse sset Master toggle-mute
# amixer -q set Master toggle
# Simple amixer command seems to have problems unmuting device
# Brightness up
XF86MonBrightnessUp
light -A 10 #xbacklight -inc 5
# And brightness down
XF86MonBrightnessDown
light -U 10 #xbacklight -dec 5
# Keyboard brightness up
XF86KbdBrightnessUp
light -s sysfs/leds/asus::kbd_backlight -A 33.34
# And Keyboard brightness down
XF86KbdBrightnessDown
light -s sysfs/leds/asus::kbd_backlight -U 33.34
# Screenshot
Print
flameshot gui #scrot ~/Pictures/Screenshot-$(date +%F_%T).png
super+Print
~/.config/bspwm/scripts/screenshot.sh
# Shortcuts
# Browser
super + b
chromium #firefox
# File Explorer
super + n
thunar
# Keybindings
super + F1
~/.config/bspwm/scripts/keybindings_rofi.sh
# Text Editor
super + a
emacsclient -c
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment