fresh init

This commit is contained in:
sankalp committed 2023-05-25 01:33:08 +05:45
1 parent 5c63104f84
commit 4ffdd8d1cf
3 files changed
+499

No files matched your search

+154
View File
@@ -0,0 +1,154 @@
#!/usr/bin/env sh
# ╔╗ ╔═╗╔═╗╦ ╦╔╦╗ - o0xjack
# ╠╩╗╚═╗╠═╝║║║║║║ - https://github.com/S4NKALP/bspwm
# ╚═╝╚═╝╩ ╚╩╝╩ ╩
## Environments.
export PATH="${PATH}:$HOME/.config/bspwm/scripts:$HOME/.config/bspwm/rofi/bin:$HOME/.local/bin"
PATH="$HOME/.config/bspwm/scripts:$PATH"
## Parse colors from "~/.Xresources" ---------------------------- #
xrdb -override "${HOME}/.Xresources"
xrdb_query()
{
[ -n "$XRDB_QUERY" ] || XRDB_QUERY="$(xrdb -query)"
echo "$XRDB_QUERY" | while IFS=';' read -r STRING; do
[ "${1}" = "${STRING%%\ *}" ] || continue
echo "${STRING##*\ }"
break
done
}
getcolors()
{
#FOREGROUND="$(xrdb_query '*.foreground:')"
BACKGROUND="$(xrdb_query '*.background:')"
BLACK="$(xrdb_query '*.color0:')"
#RED="$(xrdb_query '*.color1:')"
#GREEN="$(xrdb_query '*.color2:')"
#YELLOW="$(xrdb_query '*.color3:')"
#BLUE="$(xrdb_query '*.color4:')"
#MAGENTA="$(xrdb_query '*.color5:')"
#CYAN="$(xrdb_query '*.color6:')"
#WHITE="$(xrdb_query '*.color7:')"
}
getcolors
# Solve java apps issues (e.g. JetBrains IDEs like PyCharm, CLion, etc). #
export _JAVA_AWT_WM_NONREPARENTING=1
# Set system vars for polybar
. SetSysVars
## Configurations ----------------------------------------------- #
# ----- set En & Np for keyboard ----- #
setxkbmap -layout us,np # change 'us,np' for your own uses #
setxkbmap -option 'grp:ctrl_space_toggle'
workspaces()
{
for MONITOR in $(bspc query -M); do
name=$((name+1))
bspc monitor ${MONITOR} -n "$name" -d '一' '二' '三' '四' '五' '六' #'七' '八' '九' '十'
#bspc monitor ${MONITOR} -n "$name" -d '1' '2' '3' '4' '5' '6'
(( name++ ))
done
}
workspaces
bspc config external_rules_command $HOME/.config/bspwm/scripts/ExternalRules
bspc rule -a scratch sticky=on state=floating focus=on
bspc config top_padding 59
bspc config bottom_padding 2
bspc config left_padding 2
bspc config right_padding 2
bspc config border_width 0
bspc config window_gap 6
bspc config split_ratio 0.51
bspc config borderless_monocle false
bspc config gapless_monocle false
bspc config normal_border_color "#C574DD"
bspc config active_border_color "#C574DD"
bspc config focused_border_color "#8897F4"
bspc config presel_feedback_color "#FF4971"
bspc config focus_follows_pointer true
bspc config pointer_follows_focus false
bspc config pointer_motion_interval 5
bspc config pointer_modifier mod4
bspc config pointer_action1 move
bspc config pointer_action2 resize_side
bspc config pointer_action3 resize_corner
bspc wm --adopt-orphans
# remove all rules first #
bspc rule -r *:*
## Startup programs --------------------------------------------- #
# Terminate already running polybar, eww, picom, sxhkd and dunst instances
processes=("picom" "polybar" "eww" "sxhkd" "dunst")
for process in "${processes[@]}"; do
if pidof -q "$process"; then
pkill -x "$process" > /dev/null; sleep 0.1
fi
done
# Run polybar
#$HOME/.config/bspwm/polybar/launch.sh &
polybar &
# Launch picom // If you have old hardware or encounter problems
# uncomment the picom "--legacy-backends" line and comment the current one.
picom --config "$HOME"/.config/bspwm/picom.conf &
#picom --legacy-backends --config "$HOME"/.config/bspwm/picom.conf &
# ----- Enable power management ----- #
xfce4-power-manager &
# Run xsettingsd daemon.
xsettingsd &
# Launch polkit
pgrep -x polkit-gnome-au > /dev/null || /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
# Reload sxhkd daemon
sxhkd -c "$HOME"/.config/bspwm/sxhkdrc &
# Fix cursor.
xsetroot -cursor_name left_ptr
# Start X wallpaper.
feh -z --no-fehbg --bg-fill ~/.config/bspwm/assets/wall.webp
# Run script that gives you a warm welcome cuz it feels good to not feel alone XD
sh "${HOME}/.local/bin/hello.sh"
# Run mpd if doesn't started.
exec mpd &
exec mpdris2 &
# Kill if already running
killall -9 ksuperkey
# Enable Super Keys For Menu
ksuperkey -e 'Super_L=Alt_L|F1' &
ksuperkey -e 'Super_R=Alt_L|F1' &
# ----- enable num lock ----- #
numlockx &
# ----- Notification ----- #
dunst -config "$HOME"/.config/dust/dunstrc &
+119
View File
@@ -0,0 +1,119 @@
# ╔═╗╦╔═╗╔═╗╔╦╗ ╔═╗╔═╗╔╗╔╔═╗╦╔═╗ - z0mbi3
# ╠═╝║║ ║ ║║║║ ║ ║ ║║║║╠╣ ║║ ╦
# ╩ ╩╚═╝╚═╝╩ ╩ ╚═╝╚═╝╝╚╝╚ ╩╚═╝ - My picom configuration
#################################
# Shadows #
#################################
shadow = false;
shadow-radius = 18;
shadow-opacity = 0.90
shadow-offset-x = -23;
shadow-offset-y = -22;
shadow-color = "#000000"
shadow-exclude = [
"name = 'Notification'",
"class_g = 'Conky'",
"class_g ?= 'Notify-osd'",
"class_g = 'Cairo-clock'",
"class_g = 'slop'",
"class_g = 'scratch'",
"class_g = 'retroarch'",
"class_g = 'Rofi'",
"_GTK_FRAME_EXTENTS@:c",
"_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'"
];
#################################
# Fading #
#################################
fading = false;
fade-in-step = 0.1;
fade-out-step = 0.1;
no-fading-destroyed-argb = true
fade-delta = 20
fade-exclude = [
"class_g = 'slop'",
#"class_g = 'Rofi'",
"class_g = 'scratch'"
]
#################################
# Corners #
#################################
corner-radius = 6
rounded-corners-exclude = [
"window_type = 'dropdown_menu'",
"window_type = 'popup_menu'",
"window_type = 'popup'",
"window_type = 'dock'",
"class_g = 'Polybar'",
"class_g = 'eww-bar'",
"class_g = 'Viewnior'",
"class_g = 'Rofi'",
"class_g = 'mpv'",
"class_g = 'retroarch'"
];
#################################
# Transparency / Opacity #
#################################
inactive-opacity = 1.0;
active-opacity = 1.0
inactive-opacity-override = false;
focus-exclude = [
"class_g = 'Cairo-clock'",
"class_g = 'slop'" # maim
];
opacity-rule = [
"100:class_g = 'Alacritty'",
"100:class_g = 'FloaTerm'",
"100:class_g = 'Updating'",
"100:class_g = 'MusicPlayer'",
"100:class_g = 'Sysfetch'",
"90:class_g = 'scratch'"
];
#################################
# General Settings #
#################################
# Available backends "xrender" "glx" "egl" "xr_glx_hybrid"
backend = "glx";
#backend = "xrender";
dithered-present = false;
vsync = true;
mark-wmwin-focused = true;
mark-ovredir-focused = true;
detect-rounded-corners = true;
detect-client-opacity = true;
detect-transient = true;
glx-no-stencil = true;
use-damage = true;
log-level = "warn";
#################################
# Wintypes #
#################################
wintypes:
{
normal = { fade = true; shadow = true; }
tooltip = { fade = false; shadow = false; focus = true; full-shadow = false; }
dock = { shadow = false; clip-shadow-above = true; }
dnd = { shadow = false; }
};
+226
View File
@@ -0,0 +1,226 @@
################################################
## ██████ ▒██ ██▒ ██░ ██ ██ ▄█▀▓█████▄ ##
## ▒██ ▒ ▒▒ █ █ ▒░▓██░ ██▒ ██▄█▒ ▒██▀ ██▌ ##
## ░ ▓██▄ ░░ █ ░▒██▀▀██░▓███▄░ ░██ █▌ ##
## ▒ ██▒ ░ █ █ ▒ ░▓█ ░██ ▓██ █▄ ░▓█▄ ▌ ##
## ▒██████▒▒▒██▒ ▒██▒░▓█▒░██▓▒██▒ █▄░▒████▓ ##
## ▒ ▒▓▒ ▒ ░▒▒ ░ ░▓ ░ ▒ ░░▒░▒▒ ▒▒ ▓▒ ▒▒▓ ▒ ##
## ░ ░▒ ░ ░░░ ░▒ ░ ▒ ░▒░ ░░ ░▒ ▒░ ░ ▒ ▒ ##
## ░ ░ ░ ░ ░ ░ ░░ ░░ ░░ ░ ░ ░ ░ ##
## ░ ░ ░ ░ ░ ░░ ░ ░ ##
## ░ ##
################################################ By: S4NKALP https://github.com/S4NKALP
# Toggle right click context menu.
~button3
xqp 0 $(xdo id -N Bspwm -n root) && jgmenu_run
# Terminal
super + Return
OpenApps --terminal
# Terminal (floating)
super + shift + Return
OpenApps --floating
# Scratchpad
super + alt + o
tdrop -a -w 70% -h 35% -y 0 -x 15% --class scratch alacritty --class=scratch
# Rofi App Launcher
alt + space
OpenApps --menu
# HotKeys
alt + F1
sxhkd-help
#Rofi Network Menu
super + n
nmd
# Window Switcher
super + w
windows
#screenRecord
super + shift + r
screenrecord capture-rofi
#Emoji
super + e
rofi -modi emoji -show emoji -theme "$HOME/.config/bspwm/rofi/rasi/emoji/emojimenu.rasi"
# Power off, Reboot, Log out, Lockscreen, kill an app
ctrl + shift + alt + {p,r,q,l,k}
{systemctl poweroff, systemctl reboot,bspc quit,lockscreen,xkill}
# Launch Apps
alt + {e,f,t,x,w,s}
{thunar, \
firefox, \
telegram-desktop, \
firefox --private-window, \
whatsapp-nativefier --disable-gpu, \
env LD_PRELOAD=/usr/lib/spotify-adblock.so spotify --disable-gpu --no-zygote %U, \ }
# Take a screenshot
Print
screenshot shot-screen
# Take screenshot in 5 second
alt + Print
screenshot shot-in3
# Take screenshot in 10 second
shift + Print
screenshot shot-in10
# Take screenshot of active window
ctrl + Print
screenshot shot-window
# Take screenshot of area
super + z
screenshot shot-area
# Manage brightness
XF86MonBrightness{Up,Down}
brightness {up,down}
Manage volume
XF86Audio{Raise,Lower}Volume
volume {up,down}
XF86AudioMute
volume mute
# Music control
XF86Audio{Next,Prev,Play,Stop}
mpc {next,prev,toggle,stop}
# Close App
super + {_,shift + }c
bspc node -{c,k}
# Reload Keybindings
super + Escape
pkill -USR1 -x sxhkd; dunstify -u low -i ~/.config/bspwm/assets/icons/reload.svg 'sxhkd' 'Reloaded successfully!'
# kill window
alt + F4
xkill
# Quit/Restart bspwm
ctrl + shift + {q,r}
bspc {quit,wm -r}
# rotate desktop
super + r
bspc node @/ --rotate {90,-90}
#Hide Winodw
super + shift + i
winmask
# Make split ratios equal
super + equal
bspc node @/ --equalize
# Make split ratios balanced
super + minus
bspc node @/ --balance
# swap the current node and the biggest node
super + g
bspc node -s biggest
# Fullscreen or Monocle
super + f
# bspc desktop -l next
bspc node -t "~"fullscreen
# Monocle
super + shift + f
bspc desktop -l next
# Toggle beetwen floating & tiled
super + space
bspc node -t "~"{floating,tiled}
# Pseudo Tiled & tiled mode
super + alt + space
# set the node flags
ctrl + alt {m,x,s,p,i}
bspc node -g {marked,locked,sticky,private,hidden}
# focus the node in the given direction
super + shift + {Left,Down,Up,Right}
bspc node -{f,s} {west,south,north,east}
# focus the node for the given path jump
super + alt + {p,b,comma,period}
bspc node -f @{parent,brother,first,second}
# focus the next/previous window in the current desktop
shift + Tab
bspc node -f {next,prev}.local.!hidden.window
# Switch workspace
shift + alt + {a,d}
bspc desktop -f {prev.local,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}'
# Focused desktop window gaps scroll
shift + alt + {1,2}
bspc config -d focused window_gap $((`bspc config -d focused window_gap` {-,+} 5 ))
# Global window gaps scroll
ctrl + alt + {1,2}
bspc config window_gap $(( $(bspc config window_gap) {-,+} 5 ))
# preselect the direction
super + ctrl + {Left,Down,Up,Right}
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
Escape
bspc node -p cancel
# cancel the preselection for the focused desktop
Ctrl + Escape
bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
# expand a window by moving one of its side outward
super + alt + {Right,Up,Down,Left}
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 + {Right,Up,Down,Left}
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}