Add graphical configs

This commit is contained in:
Ngô Ngọc Đức Huy 2021-03-10 09:10:29 +07:00
parent 0d5dab99ae
commit dca7f8f487
Signed by: huyngo
GPG Key ID: 904AF1C7CDF695C3
7 changed files with 581 additions and 0 deletions

37
bspwm/bspwmrc Executable file
View File

@ -0,0 +1,37 @@
#! /bin/sh
pgrep -x sxhkd > /dev/null || sxhkd &
bspc monitor eDP-1 -d 0 1 2 3 4
# No gap
bspc config window_gap 2
bspc config border_width 2
bspc config split_ratio 0.52
bspc config borderless_monocle true
bspc config gapless_monocle true
# Orange-ish highlight
bspc config focused_border_color "#eeaa44"
# Dual monitor setup
external_monitor=$(xrandr --query | grep 'HDMI-1')
if [[ $external_monitor = *connected* ]]; then
bspc monitor HDMI-1 -d 5 6 7 8 9
xrandr --output HDMI-1 --primary --mode 1920x1080 --rotate normal --output eDP-1 --mode 1920x1080 --rotate normal --right-of HDMI-1
else
xrandr --output eDP-1 --mode 1920x1080 --rotate normal
fi
# Polybar
if [ -x /usr/bin/polybar ]; then
bash $HOME/.config/polybar/launch.sh
fi
feh --bg-center $(find ~/wallpapers -type f | grep jpg| shuf -n 1)
# Other stuff
# xsetroot -cursor_name left_ptr &

13
polybar/check.pl Normal file
View File

@ -0,0 +1,13 @@
#test-fonts.pl
use strict;
use warnings;
use Font::FreeType;
my ($char) = @ARGV;
foreach my $font_def (`fc-list`) {
my ($file, $name) = split(/: /, $font_def);
my $face = Font::FreeType->new->face($file);
my $glyph = $face->glyph_from_char($char);
if ($glyph) {
print $font_def;
}
}

24
polybar/config Normal file
View File

@ -0,0 +1,24 @@
[section/base]
include-file = /home/xarvos/.config/polybar/master.conf
include-file = /home/xarvos/.config/polybar/modules.conf
[bar/eDP1]
inherit = bar/master
monitor = eDP-1
modules-right = pulseaudio xkeyboard memory cpu wlan battery date
[bar/HDMI1]
inherit = bar/master
monitor = HDMI-1
[settings]
screenchange-reload = true
;compositing-background = xor
;compositing-background = screen
;compositing-foreground = source
;compositing-border = over
;pseudo-transparency = false
[global/wm]
margin-top = 5
margin-bottom = 0

13
polybar/launch.sh Executable file
View File

@ -0,0 +1,13 @@
# Launch
killall -q polybar
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
polybar eDP1 &
# Dual monitor bar
external_monitor=$(xrandr --query | grep 'HDMI-1')
if [[ $external_monitor = *connected* ]]; then
polybar HDMI1 &
fi

62
polybar/master.conf Normal file
View File

@ -0,0 +1,62 @@
[colors]
;background = ${xrdb:color0:#222}
background = #3b4252
background-alt = #4c566a
;foreground = ${xrdb:color7:#222}
foreground = #e5e9f0
foreground-alt = #4c566a
primary = #81a1c1
secondary = #b48ead
alert = #bf616a
[bar/master]
width = 100%
height = 17
;offset-x = 1%
;offset-y = 1%
radius = 0.0
fixed-center = false
;fonts
font-0 = Hack:pixelsize=12;1
font-1 = unifont:fontformat=truetype:size=12:antialias=false;0
font-2 = "FontAwesome:style=Regular:pixelsize=12;2"
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 2
line-color = #81a1c1
border-size = 2
border-color = #3b4252
padding-left = 0
padding-right = 2
module-margin-left = 1
module-margin-right = 4
modules-left = bspwm
#modules-center = mpd
#modules-right = filesystem alsa pulseaudio xkeyboard memory cpu wlan eth battery temperature date powermenu
modules-right = date
tray-position = none
tray-padding = 2
;tray-background = #0063ff
wm-restack = bspwm
;override-redirect = true
;scroll-up = bspwm-desknext
;scroll-down = bspwm-deskprev
;scroll-up = i3wm-wsnext
;scroll-down = i3wm-wsprev
cursor-click = pointer
cursor-scroll = ns-resize
enable-ipc = true

298
polybar/modules.conf Normal file
View File

@ -0,0 +1,298 @@
[module/xwindow]
type = internal/xwindow
label = %title:0:30:...%
[module/xkeyboard]
type = internal/xkeyboard
blacklist-0 = num lock
format-prefix = "XKB "
format-prefix-foreground = ${colors.foreground-alt}
format-prefix-underline = ${colors.secondary}
label-layout = %layout% %variant%
label-layout-underline = ${colors.secondary}
label-indicator-padding = 2
label-indicator-margin = 1
label-indicator-background = ${colors.secondary}
label-indicator-underline = ${colors.secondary}
[module/filesystem]
type = internal/fs
interval = 25
mount-0 = /
label-mounted = %{F#0a81f5}%mountpoint%%{F-}: %percentage_used%%
label-unmounted = %mountpoint% not mounted
label-unmounted-foreground = ${colors.foreground-alt}
[module/bspwm]
type = internal/bspwm
label-focused = %index%
label-focused-background = ${colors.background-alt}
label-focused-underline= ${colors.primary}
label-focused-padding = 2
label-occupied = %index%
label-occupied-padding = 2
label-urgent = %index%!
label-urgent-background = ${colors.alert}
label-urgent-padding = 2
label-empty = %index%
label-empty-foreground = ${colors.foreground-alt}
label-empty-padding = 2
; Separator in between workspaces
; label-separator = |
[module/mpd]
type = internal/mpd
format-online = <label-song> <icon-prev> <icon-stop> <toggle> <icon-next>
icon-prev = "<<"
icon-stop = "[]"
icon-play = ">"
icon-pause = "||"
icon-next = ">>"
label-song-maxlen = 25
label-song-ellipsis = true
[module/xbacklight]
type = internal/xbacklight
format = <label> <bar>
label = BL
bar-width = 10
bar-indicator = |
bar-indicator-foreground = #fff
bar-indicator-font = 2
bar-fill = ─
bar-fill-font = 2
bar-fill-foreground = #9f78e1
bar-empty = ─
bar-empty-font = 2
bar-empty-foreground = ${colors.foreground-alt}
[module/backlight-acpi]
inherit = module/xbacklight
type = internal/backlight
card = intel_backlight
[module/cpu]
type = internal/cpu
interval = 2
format-prefix = "CPU "
format-prefix-foreground = ${colors.foreground-alt}
format-underline = #bf616a
label = %percentage:2%%
[module/memory]
type = internal/memory
interval = 2
format-prefix = "MEM "
format-prefix-foreground = ${colors.foreground-alt}
format-underline = #81a1c1
label = %percentage_used%%
[module/wlan]
type = internal/network
interface = wlp2s0
interval = 3.0
format-prefix = "WIFI "
format-connected = <ramp-signal> <label-connected>
format-connected-underline = #9f78e1
label-connected = %essid%
format-disconnected =
;format-disconnected = <label-disconnected>
;format-disconnected-underline = ${self.format-connected-underline}
;label-disconnected = %ifname% disconnected
;label-disconnected-foreground = ${colors.foreground-alt}
ramp-signal-0 = 
ramp-signal-1 = 
ramp-signal-2 = 
ramp-signal-3 = 
ramp-signal-4 = 
ramp-signal-foreground = ${colors.foreground-alt}
[module/eth]
type = internal/network
interface = net0
interval = 3.0
format-connected-underline = #55aa55
format-connected-prefix = " "
format-connected-prefix-foreground = ${colors.foreground-alt}
label-connected = %local_ip%
format-disconnected =
;format-disconnected = <label-disconnected>
;format-disconnected-underline = ${self.format-connected-underline}
;label-disconnected = %ifname% disconnected
;label-disconnected-foreground = ${colors.foreground-alt}
[module/date]
type = internal/date
interval = 30
date = "%Y-%m-%d"
# date-alt = " %Y-%m-%d"
time = %H:%M
# time-alt = %H:%M:%S
# format-prefix = %{T3} %{T-}
format-prefix = "TIME "
format-prefix-foreground = ${colors.foreground-alt}
format-underline = #ebcb8b
label = %date% %time%
;hidden = true
[module/pulseaudio]
type = internal/pulseaudio
format-volume = <label-volume> <bar-volume>
label-volume = VOL %percentage%%
label-volume-foreground = ${root.foreground}
label-muted = 🔇 muted
label-muted-foreground = #666
bar-volume-width = 10
bar-volume-foreground-0 = #a3be8c
bar-volume-foreground-1 = #a3be8c
bar-volume-foreground-2 = #a3be8c
bar-volume-foreground-3 = #a3be8c
bar-volume-foreground-4 = #a3be8c
bar-volume-foreground-5 = #ebcb8b
bar-volume-foreground-6 = #bf616a
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-font = 2
bar-volume-fill = ─
bar-volume-fill-font = 2
bar-volume-empty = ─
bar-volume-empty-font = 2
bar-volume-empty-foreground = ${colors.foreground-alt}
[module/alsa]
type = internal/alsa
format-volume = <label-volume> <bar-volume>
label-volume = VOL
label-volume-foreground = ${root.foreground}
format-muted-prefix = " "
format-muted-foreground = ${colors.foreground-alt}
label-muted = sound muted
bar-volume-width = 10
bar-volume-foreground-0 = #a3be8c
bar-volume-foreground-1 = #a3be8c
bar-volume-foreground-2 = #a3be8c
bar-volume-foreground-3 = #a3be8c
bar-volume-foreground-4 = #a3be8c
bar-volume-foreground-5 = #ebcb8b
bar-volume-foreground-6 = #bf616a
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-font = 2
bar-volume-fill = ─
bar-volume-fill-font = 2
bar-volume-empty = ─
bar-volume-empty-font = 2
bar-volume-empty-foreground = ${colors.foreground-alt}
[module/battery]
type = internal/battery
battery = BAT0
adapter = ADP0
full-at = 55
interval = 60
format-charging = <animation-charging> <label-charging>
format-charging-underline = #a3be8c
format-discharging = <animation-discharging> <label-discharging>
format-discharging-underline = ${self.format-charging-underline}
format-full-prefix = "BAT "
format-full-prefix-foreground = ${colors.foreground-alt}
format-full-underline = ${self.format-charging-underline}
ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-foreground = ${colors.foreground-alt}
animation-charging-0 = 
animation-charging-1 = 
animation-charging-2 = 
animation-charging-foreground = ${colors.foreground-alt}
animation-charging-framerate = 750
animation-discharging-0 = 
animation-discharging-1 = 
animation-discharging-2 = 
animation-discharging-foreground = ${colors.foreground-alt}
animation-discharging-framerate = 750
[module/temperature]
type = internal/temperature
thermal-zone = 0
warn-temperature = 60
format = <ramp> <label>
format-underline = #f50a4d
format-warn = <ramp> <label-warn>
format-warn-underline = ${self.format-underline}
label = %temperature-c%
label-warn = %temperature-c%
label-warn-foreground = ${colors.secondary}
ramp-0 = 
ramp-1 = 
ramp-2 = 
ramp-foreground = ${colors.foreground-alt}
[module/powermenu]
type = custom/menu
expand-right = true
format-spacing = 1
label-open = 
label-open-foreground = ${colors.secondary}
label-close =  cancel
label-close-foreground = ${colors.secondary}
label-separator = |
label-separator-foreground = ${colors.foreground-alt}
menu-0-0 = reboot
menu-0-0-exec = menu-open-1
menu-0-1 = power off
menu-0-1-exec = menu-open-2
menu-1-0 = cancel
menu-1-0-exec = menu-open-0
menu-1-1 = reboot
menu-1-1-exec = sudo reboot
menu-2-0 = power off
menu-2-0-exec = sudo poweroff
menu-2-1 = cancel
menu-2-1-exec = menu-open-0

134
sxhkd/sxhkdrc Executable file
View File

@ -0,0 +1,134 @@
#
# wm independent hotkeys
#
# terminal emulator
super + t
terminator
# program launcher
super + @space
dmenu_run
# Start Firefox
super + f
firefox
# make sxhkd reload its configuration files:
super + Escape
pkill -USR1 -x sxhkd
# switch keyboard layout
ctrl + {1,2}
setxkbmap -layout us {_,-variant intl}
#
# bspwm hotkeys
#
# quit/restart bspwm
super + alt + {q,r}
bspc {quit,wm -r}
# close and kill
super + 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.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}
super + alt + {Left,Down,Up,Right}
dir={west,south,north,east}; \
bspc node -s "$dir.local" -- follow \
|| bspc node -m "$dir" -- follow
# 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}