Initial dotfiles

This commit is contained in:
Philip Henning 2017-12-25 17:35:45 +01:00
parent 492e07f40a
commit 8ca52fb1e6
26 changed files with 1255 additions and 0 deletions

View file

@ -0,0 +1,217 @@
;=======================================
;
; Polybar configuration for
; Dell XPS 15 9560
; with bspwm
;
; by Philip "ShokiNN'" Henning
; <mail+polybar@philip-henning.com>
;
;=======================================
[colors]
; Smyck color scheme by hukl
; https://github.com/hukl/Smyck-Color-Scheme
dark-black = #000
light-black = #5D5D5D
dark-red = #C75646
light-red = #E09690
dark-green = #8EB33B
light-green = #CDEE69
dark-yellow = #D0B03C
light-yellow = #FFE377
dark-blue = #4E90A7
light-blue = #9CD9F0
dark-magenta = #C8A0D1
light-magenta = #FBB1F9
dark-cyan = #218693
light-cyan = #77DFD8
dark-white = #B0B0B0
light-white = #F7F7F7
[bar/9560-top]
; Define bar monitor
monitor = "eDP-1"
; Enable support for inter-process messaging
; See the Messaging wiki page for more details.
enable-ipc = true
; Put the bar at the bottom of the screen
bottom = false
; Prefer fixed center position for the `modules-center` block
; When false, the center position will be based on the size of the other blocks.
fixed-center = false
; Set size of the bar
width = 100%
height = 24
; Bar offsets
offset-x = 0%
offset-y = 0
; Number of spaces to add at the beginning/end of the bar
; Individual side values can be defined using:
; padding-{left,right}
padding = 2
; Set Bar Colors
background = ${colors.dark-black}
foreground = ${colors.dark-white}
; Under-/overline pixel size and argb color
; Individual values can be defined using:
; {overline,underline}-size
; {overline,underline}-color
line-size = 2
; Fonts are defined using <font-name>;<vertical-offset>
; Font names are specified using a fontconfig pattern.
; font-0 = NotoSans-Regular:size=8;2
; font-1 = MaterialIcons:size=10
; font-2 = Termsynu:size=8;-1
; font-3 = FontAwesome:size=10
; See the Fonts wiki page for more details
font-0 = SourceCodePro+Powerline+Awesome Regular-Regular:size=9
font-1 = Font Awesome 5 Free Regular-Regular:size=9
font-2 = Font Awesome 5 Free Solid-Solid:size=9
font-3 = Font Awesome 5 Free Solid-Book:size=9
font-4 = Font Awesome 5 Brands Regular-Regular:siye=9
; The separator will be inserted between the output of each module
separator =
; Number of spaces to add before/after each module
; Individual side values can be defined using:
; module-margin-{left,right}
module-margin = 1
; Modules are added to one of the available blocks
; modules-left = cpu ram
; modules-center = xwindow xbacklight
; modules-right = ipc clock
modules-left = bspwm
modules-center = title
modules-right = cpu memory backlight volume battery date
; Position of the system tray window
; If empty or undefined, tray support will be disabled
; NOTE: A center aligned tray will cover center aligned modules
;
; Available positions:
; left
; center
; right
tray-position = right
; If true, the bar will not shift its
; contents when the tray changes
tray-detached = false
; Tray icon max size
tray-maxsize = 16
; Enable pseudo transparency
; Will automatically be enabled if a fully transparent
; background color is defined using `tray-background`
tray-transparent = false
; Background color for the tray container
; By default the tray container will use the bar
; background color.
; Note: 32 bit alpha blending is not supported.
tray-background = ${root.background}
; Tray offset defined as pixel value (e.g. 35) or percentage (e.g. 50%)
tray-offset-x = 5
tray-offset-y = 0
; Pad the sides of each tray icon
tray-padding = 1
; Scale factor for tray clients
tray-scale = 1.0
; Locale used to localize various module data (e.g. date)
; Expects a valid libc locale, for example: sv_SE.UTF-8
locale = de_DE.UTF-8
[bar/9560-bottom]
; Define bar monitor
monitor = "eDP-1"
; Enable support for inter-process messaging
; See the Messaging wiki page for more details.
enable-ipc = true
; Put the bar at the bottom of the screen
bottom = true
; Prefer fixed center position for the `modules-center` block
; When false, the center position will be based on the size of the other blocks.
fixed-center = false
; Set size of the bar
width = 100%
height = 24
; Bar offsets
offset-x = 0%
offset-y = 0
; Number of spaces to add at the beginning/end of the bar
; Individual side values can be defined using:
; padding-{left,right}
padding = 2
; Set Bar Colors
background = ${colors.dark-black}
foreground = ${colors.dark-white}
; Under-/overline pixel size and argb color
; Individual values can be defined using:
; {overline,underline}-size
; {overline,underline}-color
line-size = 2
; Fonts are defined using <font-name>;<vertical-offset>
; Font names are specified using a fontconfig pattern.
; font-0 = NotoSans-Regular:size=8;2
; font-1 = MaterialIcons:size=10
; font-2 = Termsynu:size=8;-1
; font-3 = FontAwesome:size=10
; See the Fonts wiki page for more details
font-0 = SourceCodePro+Powerline+Awesome Regular-Regular:size=9
font-1 = Font Awesome 5 Free Regular-Regular:size=9
font-2 = Font Awesome 5 Free Solid-Solid:size=9
font-3 = Font Awesome 5 Free Solid-Book:size=9
font-4 = Font Awesome 5 Brands Regular-Regular:siye=9
; The separator will be inserted between the output of each module
separator =
; Number of spaces to add before/after each module
; Individual side values can be defined using:
; module-margin-{left,right}
module-margin = 1
; Modules are added to one of the available blocks
; modules-left = cpu ram
; modules-center = xwindow xbacklight
; modules-right = ipc clock
modules-left = filesystem
modules-center =
modules-right = wired-network-usb-right wired-network-usb-left wifi powermenu
; Locale used to localize various module data (e.g. date)
; Expects a valid libc locale, for example: sv_SE.UTF-8
locale = de_DE.UTF-8
;
;
; include modules configuration
include-file = $HOME/.config/polybar/mod_config

View file

@ -0,0 +1,5 @@
#!/usr/bin/env bash
load=$(uptime | grep -ohe 'load average[s:][: ].*' | sed 's/,//g' | awk '{print $3" "$4" "$5}')
echo -n $load

View file

@ -0,0 +1,13 @@
#!/usr/bin/env sh
# Terminate already running bar instances
killall -q polybar
killall -q refresh_bar_usb_nic.sh
# Wait until the processes have been shut down
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
# Launch bar1 and bar2
polybar -r -q 9560-top &
polybar -r -q 9560-bottom &
$HOME/.config/polybar/refresh_bar_usb_nic.sh &

View file

@ -0,0 +1,355 @@
;
; Modules LEFT
; BSPWM
[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.
; Default: true
pin-workspaces = true
; Create click handler used to focus workspace
; Default: true
enable-click = true
; Create scroll handlers used to cycle workspaces
; Default: true
enable-scroll = false
; Set the scroll cycle direction
; Default: true
reverse-scroll = false
; Label for focused workspaces
label-focused = %name%
label-focused-foreground = ${colors.light-white}
label-focused-background = ${colors.light-black}
label-focused-underline= ${colors.dark-yellow}
label-focused-padding = 1
; Label for occupied workspaces
label-occupied = %name%
label-occupied-foreground = ${colors.dark-yellow}
label-occupied-padding = 1
; Label for urgend workspaces
label-urgent = %name%!
label-urgent-background = ${colors.light-red}
label-urgent-padding = 1
; Label for empty workspaces
label-empty = %name%
label-empty-foreground = ${colors.dark-white}
label-empty-padding = 1
; filesystem
[module/filesystem]
type = internal/fs
interval = 25
mount-0 = /
mount-1 = /home
mount-2 = /boot
mount-3 = /esp
mount-4 = /tmp
label-mounted = %{F#0a81f5}%mountpoint%%{F-}: %used% (%percentage_used%%)/%free%
label-unmounted = %mountpoint% not mounted
label-unmounted-foreground = ${colors.dark-white}
; Spacing between entries
; Default: 2
spacing = 1
;
; Modules CENTER
[module/title]
type = internal/xwindow
format-foreground = ${colors.dark-white}
format-padding = 1
; Available tokens:
; %title%
; Default: %title%
label = %title%
label-maxlen = 100
;
; Modules RIGHT
; backlight - uses ACPI
; (DEPRECAED!) - xbacklight does not work with modesetting driver
[module/backlight]
type = internal/backlight
card = intel_backlight
format = <label> <bar>
format-underline = ${colors.dark-red}
label = 
bar-width = 10
bar-indicator = |
bar-indicator-foreground = ${colors.dark-red}
bar-fill = ─
bar-fill-foreground = ${colors.dark-red}
bar-empty = ─
bar-empty-foreground = ${colors.dark-white}
; battery
[module/battery]
type = internal/battery
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
; see "man date" for details on how to format the time string
; NOTE: if you want to use syntax tags here you need to use %%{...}
; Default: %H:%M:%S
time-format = %H:%M
format-charging = <animation-charging> <label-charging>
format-charging-underline = ${colors.dark-green}
label-charging = %percentage%% %time%h
format-discharging = <ramp-capacity> <label-discharging>
format-discharging-underline = ${self.format-charging-underline}
label-discharging = %percentage%% %time%h
format-full = <ramp-capacity>
format-full-underline = ${self.format-charging-underline}
; Only applies if <ramp-capacity> is used
ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-3 = 
ramp-capacity-4 = 
ramp-capacity-font = 1
; Only applies if <animation-charging> is used
animation-charging-0 = 
animation-charging-1 = 
animation-charging-2 = 
animation-charging-3 = 
animation-charging-4 = 
animation-charging-font = 1
; Framerate in milliseconds
animation-charging-framerate = 750
; CPU load
[module/cpu]
type = custom/script
interval = 5
exec = ~/.config/polybar/cpuload.sh
label = CPU: %output%
format = <label>
format-underline = ${colors.dark-cyan}
; Date (Clock and Date)
[module/date]
type = internal/date
; refresh rate
interval = 1
; date syntax
date = "%d.%m.%Y"
; time syntax
time = "%H:%M:%S"
format-prefix-foreground = ${colors.dark-white}
format-underline = ${colors.dark-blue}
label =  %date%  %time%
; Memory usage
[module/memory]
type = internal/memory
; Seconds to sleep between updates
; Default: 1
interval = 5
format = <label>
format-underline = ${colors.light-cyan}
; Available tokens:
; %percentage_used% (default)
; %percentage_free%
; %gb_used%
; %gb_free%
; %gb_total%
; %mb_used%
; %mb_free%
; %mb_total%
label = RAM: %gb_used%/%gb_free%
; Only applies if <bar-used> is used
bar-used-indicator =
bar-used-width = 10
bar-used-foreground-0 = #55aa55
bar-used-foreground-1 = #557755
bar-used-foreground-2 = #f5a70a
bar-used-foreground-3 = #ff5555
bar-used-fill = ▐
bar-used-empty = ▐
bar-used-empty-foreground = #444444
; powermenu
[module/powermenu]
type = custom/menu
format-spacing = 1
label-open = 
label-open-foreground = ${colors.dark-red}
lable-open-font = 1
label-close =  cancel
label-close-foreground = ${colors.dark-red}
label-separator = |
label-separator-foreground = ${colors.dark-white}
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 = reboot
menu-1-0-exec = reboot
menu-2-0 = power off
menu-2-0-exec = shutdown -h -t 0 now
; volume
[module/volume]
type = internal/volume
format-volume = <label-volume> <bar-volume>
format-volume-underline = ${colors.dark-magenta}
label-volume = 
lable-volume-font = 2
label-volume-foreground = ${root.foreground}
format-muted-underline = ${self.format-volume-underline}
format-muted-prefix = " "
format-muted-prefix-font = 2
format-muted-foreground = ${colors.dark-white}
label-muted = sound muted
bar-volume-width = 10
bar-volume-foreground-0 = #55aa55
bar-volume-foreground-1 = #55aa55
bar-volume-foreground-2 = #55aa55
bar-volume-foreground-3 = #55aa55
bar-volume-foreground-4 = #55aa55
bar-volume-foreground-5 = #f5a70a
bar-volume-foreground-6 = #ff5555
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-fill = ─
bar-volume-empty = ─
bar-volume-empty-foreground = ${colors.dark-white}
; Soundcard to be used
; Usually in the format hw:#
master-soundcard = default
speaker-soundcard = default
headphone-soundcard = default
; Name of the master mixer
; Default: Master
master-mixer = Master
; Optionally define speaker and headphone mixers
; Use the following command to list available mixer controls:
; $ amixer scontrols | sed -nr "s/.*'([[:alnum:]]+)'.*/\1/p"
; Default: none
speaker-mixer = Speaker
; Default: none
headphone-mixer = Headphone
; NOTE: This is required if headphone_mixer is defined
; Use the following command to list available device controls
; $ amixer controls | sed -r "/CARD/\!d; s/.*=([0-9]+).*name='([^']+)'.*/printf '%3.0f: %s\n' '\1' '\2'/e" | sort
; Default: none
headphone-id = 20
; Use volume mapping (similar to amixer -M and alsamixer), where the increase in volume is linear to the ear
; Default: false
mapped = true
; Internal Wifi card
[module/wifi]
type = internal/network
interface = wlp2s0
; Seconds to sleep between updates
; Default: 1
interval = 0.5
format-connected = <label-connected>
format-connected-underline = ${colors.dark-green}
format-connected-prefix = " "
format-connected-prefix-font = 2
label-connected = (%signal%%) %ifname%: %essid% | IP: %local_ip% | UP: %upspeed% DOWN: %downspeed%
label-connected-foreground = ${colors.dark-white}
format-disconnected = <label-disconnected>
format-disconnected-underline = ${colors.dark-red}
format-disconnected-prefix = " "
format-disconnected-prefix-font = 2
label-disconnected = %ifname%
label-disconnected-foreground = ${colors.dark-white}
; Left USB NIC
[module/wired-network-usb-left]
type = internal/network
interface = enp0s20f0u2
; Seconds to sleep between updates
; Default: 1
interval = 0.5
format-connected-underline = ${colors.dark-green}
format-connected-prefix = " "
format-connected-prefix-font = 2
format-connected-prefix-foreground = ${colors.dark-white}
label-connected = %ifname% (%linkspeed%) | IP: %local_ip% | UP: %upspeed% DOWN: %downspeed%
format-disconnected = <label-disconnected>
format-disconnected-underline = ${colors.dark-red}
format-disconnected-prefix = " "
format-disconnected-prefix-font = 2
label-disconnected = %ifname%
label-disconnected-foreground = ${colors.dark-white}
; Right USB NIC
[module/wired-network-usb-right]
type = internal/network
interface = enp0s20f0u1
; Seconds to sleep between updates
; Default: 5
interval = 0.5
format-connected-underline = ${colors.dark-green}
format-connected-prefix = " "
format-connected-prefix-font = 2
format-connected-prefix-foreground = ${colors.dark-white}
label-connected = %ifname% (%linkspeed%) | IP: %local_ip% | UP: %upspeed% DOWN: %downspeed%
format-disconnected = <label-disconnected>
format-disconnected-underline = ${colors.dark-red}
format-disconnected-prefix = " "
format-disconnected-prefix-font = 2
label-disconnected = %ifname%
label-disconnected-foreground = ${colors.dark-white}

View file

@ -0,0 +1,40 @@
#!/bin/bash
######################
#
# This script detects if an USB NIC was connected and reloads the bar
#
while true; do
# Get PID of the bottom bar
pid_bottom_bar=$(ps -x | awk '!/awk/ && /9560-bottom/ {print $1}')
# 1st USB port (right)
if [[ -z $USB_NIC1 ]]; then
USB_NIC1=$(ip link | awk '!/awk/ && /enp0s20f0u1/ {print $2}' | cut -d":" -f1)
if [[ -n $USB_NIC1 ]]; then
polybar-msg -p $pid_bottom_bar cmd restart
fi
elif [[ -n $USB_NIC1 ]]; then
USB_NIC1_CHECK=$(ip link | awk '!/awk/ && /enp0s20f0u1/ {print $2}' | cut -d":" -f1)
if [[ -z $USB_NIC1_CHECK ]]; then
unset USB_NIC1
polybar-msg -p $pid_bottom_bar cmd restart
fi
fi
# 2nd USB port (left)
if [[ -z $USB_NIC2 ]]; then
USB_NIC2=$(ip link | awk '!/awk/ && /enp0s20f0u2/ {print $2}' | cut -d":" -f1)
if [[ -n $USB_NIC2 ]]; then
polybar-msg -p $pid_bottom_bar cmd restart
fi
elif [[ -n $USB_NIC2 ]]; then
USB_NIC2_CHECK=$(ip link | awk '!/awk/ && /enp0s20f0u2/ {print $2}' | cut -d":" -f1)
if [[ -z $USB_NIC2_CHECK ]]; then
unset USB_NIC2
polybar-msg -p $pid_bottom_bar cmd restart
fi
fi
sleep 5
done