Skip to content

Instantly share code, notes, and snippets.

@andoriyu
Last active October 3, 2020 19:54
Show Gist options
  • Save andoriyu/96fd3e12a06b570df235baf62fbd3314 to your computer and use it in GitHub Desktop.
Save andoriyu/96fd3e12a06b570df235baf62fbd3314 to your computer and use it in GitHub Desktop.
#! /bin/sh
bspc config border_width 0
bspc config window_gap 3
bspc config split_ratio 0.52
bspc config borderless_monocle true
bspc config gapless_monocle true
bspc config click_to_focus button1
bspc config pointer_mod mod4
bspc config pointer_action1 move
bspc config pointer_action2 resize_side
bspc config pointer_action3 resize_corner
#bspc monitor DP-1 -d 1 2 3 4 5
#bspc monitor HDMI-0 -d 6 7 8 9 0
bspc config pointer_follows_monitor true
# Multihead behavior
bspc config remove_disabled_monitors true
bspc config remove_unplugged_monitors true
~/.config/bspwm/bspwmrc-local || true
exec ~/.config/bspwm/autostart
[Settings]
gtk-application-prefer-dark-theme = false
gtk-theme-name = Nordic
gtk-icon-theme-name = "Luv"
gtk-fallback-icon-theme = gnome
gtk-font-name = Fira Sans 12
include "/home/andoriyu/.themes/Nordic/gtk-2.0/gtkrc"
gtk-can-change-accels = 1
gtk-theme-name = "Nordic"
gtk-icon-theme-name = "Luv"
style "user-font"
{
font_name="Fira Sans 12"
}
widget_class "*" style "user-font"
gtk-font-name = "Fira Sans 12"
nimble {
url: "https://pkg.andoriyu.xyz/repos/11.3:amd64:system:nimble"
enabled: yes,
signature_type: "PUBKEY",
pubkey:"/usr/local/etc/ssl/keys/nimble.pub"
}
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAw9aEhuBycMss3bfqml+R
qocEDmwe8Y6/K9UiWnmds6ee7y4T1B0Ksq8Pn5jLq/jSji6R5agazKIF42w+rbOV
MKYo/tEhsIyD/AF5ie2X+AvGa0wLCmydejnGSgcV6+1zQIb0mMrt51xGF8ipdnKM
0SM0HEVSg2mhbTiM/+nHwcKBx6MBzu6N/wxMiM6KtXQF6TREdM77QWVT8umuGRSK
b6CiPkPfJ5lKfCFbUHfnGAxHngDtd91WCVb8fXKlEBoIs3J/MilJZf8LLR3bK1/+
1xGjdZ/GFDx6vNHqHhCgwvoXSL00OrFU0/KQa6AWcrKCq/RlWtNxVdChKE1zH+0X
GwIDAQAB
-----END PUBLIC KEY-----
//----------------------
// Theme Settings
//----------------------
//----------------------
// Colors
//----------------------
* {
nord0: #2E3440;
nord1: #3B4252;
nord2: #434C5E;
nord3: #4C566A;
nord4: #D8DEE9;
nord5: #E5E9F0;
nord6: #ECEFF4;
nord7: #8FBCBB;
nord8: #88C0D0;
nord9: #81A1C1;
nord10: #5E81AC;
nord11: #BF616A;
nord12: #D08770;
nord13: #EBCB8B;
nord14: #A3BE8C;
nord15: #B48EAD;
background: @nord0;
foreground: @nord4;
selected-normal-foreground: @nord4;
normal-foreground: @foreground;
alternate-normal-background: @nord0;
selected-urgent-foreground: @nord4;
urgent-foreground: @foreground;
alternate-urgent-background: @nord0;
active-foreground: @foreground;
selected-active-foreground: @foreground;
alternate-active-background: @nord0;
bordercolor: @nord11;
alternate-normal-foreground: @foreground;
normal-background: @background;
selected-normal-background: @nord3;
border-color: @nord11;
spacing: 2;
separatorcolor: @blue;
urgent-background: @background;
selected-urgent-background: @nord3;
alternate-urgent-foreground: @urgent-foreground;
background-color: @background;
alternate-active-foreground: @active-foreground;
active-background: @background;
selected-active-background: @nord3;
}
#window {
background-color: @background;
}
#mainbox {
border: 4;
padding: 20;
}
#message {
border: 4px 4px 4px ;
border-color: @separatorcolor;
padding: 20 ;
}
#textbox {
text-color: @foreground;
}
#listview {
fixed-height: 0;
padding: 5 0 0;
spacing: 5px ;
}
#element {
border: 0;
padding: 5px ;
}
#element.normal.normal {
background-color: @normal-background;
text-color: @normal-foreground;
}
#element.normal.urgent {
background-color: @urgent-background;
text-color: @urgent-foreground;
}
#element.normal.active {
background-color: @active-background;
text-color: @active-foreground;
}
#element.selected.normal {
background-color: @selected-normal-background;
text-color: @selected-normal-foreground;
}
#element.selected.urgent {
background-color: @selected-urgent-background;
text-color: @selected-urgent-foreground;
}
#element.selected.active {
background-color: @selected-active-background;
text-color: @selected-active-foreground;
}
#element.alternate.normal {
background-color: @alternate-normal-background;
text-color: @alternate-normal-foreground;
}
#element.alternate.urgent {
background-color: @alternate-urgent-background;
text-color: @alternate-urgent-foreground;
}
#element.alternate.active {
background-color: @alternate-active-background;
text-color: @alternate-active-foreground;
}
#button.selected {
background-color: @selected-normal-background;
text-color: @selected-normal-foreground;
}
#inputbar {
spacing: 5;
text-color: @normal-foreground;
padding: 5px ;
border: 0 0 2;
border-color: @separatorcolor;
}
#case-indicator {
spacing: 0;
text-color: @normal-foreground;
}
#entry {
spacing: 0;
text-color: @normal-foreground;
}
#prompt {
spacing: 0;
text-color: @normal-foreground;
}
/* vim:ft=css
*/
#!/usr/local/bin/bash
if [[ -z "$1" ]]; then
CONFIGS=$(ls /usr/local/etc/rc.d/ |grep ovpn)
for conf in $CONFIGS; do
state=$(doas /usr/local/etc/rc.d/$conf onestatus > /dev/null && echo "CONNECTED" || echo "NOT CONNECTED")
shortname=$(echo $conf | sed 's/ovpn_//g')
echo $shortname - [$state]
done
else
conf=/usr/local/etc/rc.d/ovpn_$(echo $1 | awk '{print $1}')
doas $conf onestatus >/dev/null && doas $conf onestop > /dev/null || doas $conf onestart > /dev/null
exit 0
fi
#
# wm independent hotkeys
#
# terminal emulator
super + Return
st-nord -f "FuraCode Nerd Font Mono:pixelsize=14:antialias=true"
# program launcher
super + space
rofi -show run -modi run,calc,window,pkill:~/.bin/rofi-pkill.sh,ovpn:/~/.bin/rofi-ovpn.sh -font "Fira Code 12"
# make sxhkd reload its configuration files:
super + Escape
pkill -USR1 -x sxhkd
#
# bspwm hotkeys
#
# quit bspwm normally
super + alt + Escape
bspc quit
# close and kill
super + {_,shift + }w
bspc node -{c,k}
# alternate between the tiled and monocle layout
super + m
bspc desktop -l next
# if the current node is automatic, send it to the last manual, otherwise pull the last leaf
super + y
bspc query -N -n focused.automatic && bspc node -n last.!automatic || bspc node last.leaf -n focused
# 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 + {x,y,z}
bspc node -g {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
super + {_,shift + }c
bspc node -f {next,prev}
# focus the next/previous desktop
super + bracket{left,right}
bspc desktop -f {prev,next}
# 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
#
# 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}
# move focused window to the next workspace and then switch to that workspace
alt + shift + {Left,Right}
id=$(bspc query --nodes --node); bspc node --to-desktop {prev,next}; bspc desktop --focus next;
export HOST="$HOST"
export BSD_ICON=""
export SILVER_DIR_ALIASES="/usr/home/andoriyu::/usr/home/andoriyu/dev/github.com:/ﯙ"
export SILVER_ICONS="nerd"
export SILVER_DIR_LENGTH="1"
export SILVER_SEPARATOR=""
export SILVER=(env:white:red:BSD_ICON env:cyan:black:HOST dir:blue:black git:green:black cmdtime:magenta:black status:red:white)
export SILVER_SHELL=zsh
eval "$(silver init)"
source <(awless completion zsh)
source <(kubectl completion zsh)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment