From 25c4ac296f854933f9800167c7b39a5aaf73d079 Mon Sep 17 00:00:00 2001 From: jakobst1n Date: Wed, 15 Nov 2023 06:56:04 +0100 Subject: Add bspwm/sxhkd/polybar --- Common/alacritty/alacritty.yml | 2 +- Common/bspwm/bspwmrc | 23 ++++ Common/polybar/config.ini | 275 +++++++++++++++++++++++++++++++++++++++++ Common/sxhkd/sxhkdrc | 147 ++++++++++++++++++++++ Common/zshrc | 2 +- 5 files changed, 447 insertions(+), 2 deletions(-) create mode 100755 Common/bspwm/bspwmrc create mode 100644 Common/polybar/config.ini create mode 100644 Common/sxhkd/sxhkdrc (limited to 'Common') diff --git a/Common/alacritty/alacritty.yml b/Common/alacritty/alacritty.yml index b89296b..570d8bc 100644 --- a/Common/alacritty/alacritty.yml +++ b/Common/alacritty/alacritty.yml @@ -13,7 +13,7 @@ font: normal: family: RobotoMono Nerd Font Mono - size: 8 + size: 5 window: padding: diff --git a/Common/bspwm/bspwmrc b/Common/bspwm/bspwmrc new file mode 100755 index 0000000..304ae7e --- /dev/null +++ b/Common/bspwm/bspwmrc @@ -0,0 +1,23 @@ +#! /bin/sh + +pgrep -x sxhkd > /dev/null || sxhkd & + +#compton --backend glx --vsync opengl-swc & +compton & +nitrogen --restore & +polybar & + +bspc monitor -d I II III IV V VI VII VIII IX X + +bspc config border_width 2 +bspc config window_gap 3 + +bspc config split_ratio 0.52 +bspc config borderless_monocle true +bspc config gapless_monocle true + +bspc rule -a Gimp desktop='^8' state=floating follow=on +bspc rule -a Chromium desktop='^2' +bspc rule -a mplayer2 state=floating +bspc rule -a Kupfer.py focus=on +bspc rule -a Screenkey manage=off diff --git a/Common/polybar/config.ini b/Common/polybar/config.ini new file mode 100644 index 0000000..4dff50c --- /dev/null +++ b/Common/polybar/config.ini @@ -0,0 +1,275 @@ +;========================================================== +; +; +; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗ +; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗ +; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝ +; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗ +; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║ +; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ +; +; +; To learn more about how to configure Polybar +; go to https://github.com/polybar/polybar +; +; The README contains a lot of information +; +;========================================================== + +[colors] +background = #282A2E +background-alt = #373B41 +foreground = #C5C8C6 +primary = #F0C674 +secondary = #8ABEB7 +alert = #A54242 +disabled = #707880 + +[bar/example] +width = 100% +height = 24pt +radius = 6 + +; dpi = 96 + +background = ${colors.background} +foreground = ${colors.foreground} + +line-size = 3pt + +border-size = 4pt +border-color = #00000000 + +padding-left = 0 +padding-right = 1 + +module-margin = 1 + +separator = | +separator-foreground = ${colors.disabled} + +font-0 = monospace;2 + +modules-left = xworkspaces +modules-right = pulseaudio xkeyboard memory cpu wlan eth battery date + +cursor-click = pointer +cursor-scroll = ns-resize + +enable-ipc = true + +; tray-position = right + +; wm-restack = generic +; wm-restack = bspwm +; wm-restack = i3 + +; override-redirect = true + +[module/bspwm] +type = internal/bspwm + +; Only show workspaces defined on the same output as the bar +; NOTE: The bspwm and XRandR monitor names must match, which they do by default. +; But if you rename your bspwm monitors with bspc -n this option will no longer +; behave correctly. +; Default: true +pin-workspaces = true + +; Output mode flags after focused state label +; Default: false +inline-mode = false + +; Create click handler used to focus workspace +; Default: true +enable-click = false + +; Create scroll handlers used to cycle workspaces +; Default: true +enable-scroll = false + +; Set the scroll cycle direction +; Default: true +reverse-scroll = false + +; Use fuzzy (partial) matching on labels when assigning +; icons to workspaces +; Example: code;♚ will apply the icon to all workspaces +; containing 'code' in the label +; Default: false +fuzzy-match = true + +; Only scroll through occupied workspaces +; Default: false +; New in version 3.6.0 +occupied-scroll = true + +[module/xworkspaces] +type = internal/xworkspaces + +label-active = %name% +label-active-background = ${colors.background-alt} +label-active-underline= ${colors.primary} +label-active-padding = 1 + +label-occupied = %name% +label-occupied-padding = 1 + +label-urgent = %name% +label-urgent-background = ${colors.alert} +label-urgent-padding = 1 + +label-empty = %name% +label-empty-foreground = ${colors.disabled} +label-empty-padding = 1 + +[module/xwindow] +type = internal/xwindow +label = %title:0:60:...% + +[module/filesystem] +type = internal/fs +interval = 25 + +mount-0 = / + +label-mounted = %{F#F0C674}%mountpoint%%{F-} %percentage_used%% + +label-unmounted = %mountpoint% not mounted +label-unmounted-foreground = ${colors.disabled} + +[module/pulseaudio] +type = internal/pulseaudio + +format-volume-prefix = "VOL " +format-volume-prefix-foreground = ${colors.primary} +format-volume = + +label-volume = %percentage%% + +label-muted = muted +label-muted-foreground = ${colors.disabled} + +[module/xkeyboard] +type = internal/xkeyboard +blacklist-0 = num lock + +label-layout = %layout% +label-layout-foreground = ${colors.primary} + +label-indicator-padding = 2 +label-indicator-margin = 1 +label-indicator-foreground = ${colors.background} +label-indicator-background = ${colors.secondary} + +[module/memory] +type = internal/memory +interval = 2 +format-prefix = "RAM " +format-prefix-foreground = ${colors.primary} +label = %percentage_used:2%% + +[module/cpu] +type = internal/cpu +interval = 2 +format-prefix = "CPU " +format-prefix-foreground = ${colors.primary} +label = %percentage:2%% + +[network-base] +type = internal/network +interval = 5 +format-connected = +format-disconnected = +label-disconnected = %{F#F0C674}%ifname%%{F#707880} disconnected + +[module/wlan] +inherit = network-base +interface-type = wireless +label-connected = %{F#F0C674}%ifname%%{F-} %essid% %local_ip% + +[module/eth] +inherit = network-base +interface-type = wired +label-connected = %{F#F0C674}%ifname%%{F-} %local_ip% + +[module/date] +type = internal/date +interval = 1 + +date = %H:%M +date-alt = %Y-%m-%d %H:%M:%S + +label = %date% +label-foreground = ${colors.primary} + +[module/battery] +type = internal/battery + +; This is useful in case the battery never reports 100% charge +; Default: 100 +full-at = 99 + +; format-low once this charge percentage is reached +; Default: 10 +; New in version 3.6.0 +low-at = 10 + +; Use the following command to list batteries and adapters: +; $ ls -1 /sys/class/power_supply/ +battery = BAT0 +adapter = ADP1 + +; If an inotify event haven't been reported in this many +; seconds, manually poll for new values. +; +; Needed as a fallback for systems that don't report events +; on sysfs/procfs. +; +; Disable polling by setting the interval to 0. +; +; Default: 5 +poll-interval = 5 + +label-charging = Charging %percentage%% + +[module/temperature] +type = internal/temperature + +; Seconds to sleep between updates +; Default: 1 +interval = 0.5 + +; Thermal zone to use +; To list all the zone types, run +; $ for i in /sys/class/thermal/thermal_zone*; do echo "$i: $(<$i/type)"; done +; Default: 0 +thermal-zone = 0 + +; Select thermal zone by name +; The name has to match the contents of /sys/class/thermal/thermal_zone*/type +; for the desired thermal zone. +; New in version 3.7.0 +; Default: "" +zone-type = x86_pkg_temp + +; Full path of temperature sysfs path +; Use `sensors` to find preferred temperature source, then run +; $ for i in /sys/class/hwmon/hwmon*/temp*_input; do echo "$(<$(dirname $i)/name): $(cat ${i%_*}_label 2>/dev/null || echo $(basename ${i%_*})) $(readlink -f $i)"; done +; to find path to desired file +; Default reverts to thermal zone setting +hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input + +; Base temperature for where to start the ramp (in degrees celsius) +; Default: 0 +base-temperature = 20 + +; Threshold temperature to display warning label (in degrees celsius) +; Default: 80 +warn-temperature = 60 + +[settings] +screenchange-reload = true +pseudo-transparency = false + +; vim:ft=dosini diff --git a/Common/sxhkd/sxhkdrc b/Common/sxhkd/sxhkdrc new file mode 100644 index 0000000..9775b11 --- /dev/null +++ b/Common/sxhkd/sxhkdrc @@ -0,0 +1,147 @@ +# +# wm independent hotkeys +# + +# terminal emulator +super + Return + alacritty + +# program launcher +super + d + rofi -show drun + +# make sxhkd reload its configuration files: +super + Escape + pkill -USR1 -x sxhkd + +# Lock +super + l + XSECURELOCK_SAVER=saver_xscreensaver xsecurelock + +# +# bspwm hotkeys +# + +# quit/restart bspwm +super + shift + c + bspc wm -r + +super + alt + q + bspc quit + +# close and kill +alt + F4 + 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.window + +# +# state/flags +# + +# set the window state +super + {t,shift + t,space,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 + +# +# 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 Control +XF86AudioLowerVolume + amixer set Master 5%- +XF86AudioRaiseVolume + amixer set Master 5%+ +XF86AudioMute + amixer set Master toggle + +# Brightness +XF86MonBrightnessDown + xbacklight -dec 5 + +XF86MonBrightnessUp + xbacklight -inc 5 + +# keyboard layouts +super + shift + @space + {setxkbmap no, setxkbmap us} diff --git a/Common/zshrc b/Common/zshrc index 0ac9347..4fb9aba 100644 --- a/Common/zshrc +++ b/Common/zshrc @@ -6,7 +6,7 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]] fi # If you come from bash you might have to change your $PATH. -export PATH=$HOME/bin:/usr/local/bin:$HOME/.local/bin:$PATH +export PATH=$HOME/bin:/usr/local/bin:$HOME/.local/bin:$PATH:$HOME/go/bin export KEYTIMEOUT=1 # Check if env setup file exists -- cgit v1.2.3