Skip to content

Commit

Permalink
update polybar & alacritty for hosts/laundry
Browse files Browse the repository at this point in the history
  • Loading branch information
ksevelyar committed Sep 17, 2023
1 parent 368b8bd commit 7c0c8f8
Show file tree
Hide file tree
Showing 4 changed files with 299 additions and 1 deletion.
8 changes: 7 additions & 1 deletion hosts/laundry.nix
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ args@{ config, lib, pkgs, ... }:
networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
networking.networkmanager.enable = true;

home-manager.users.ksevelyar = {
home.file.".config/polybar/config".source = ../users/ksevelyar/laundry/polybar;
home.file.".config/alacritty/alacritty.yml".source = ../users/ksevelyar/laundry/alacritty.yml;
home.file.".config/alacritty/alacritty-scratchpad.yml".source = ../users/ksevelyar/laundry/alacritty-scratchpad.yml;
};

services.openvpn.servers = {
uk-shark.autoStart = false;
express.autoStart = false;
Expand Down Expand Up @@ -89,7 +95,7 @@ args@{ config, lib, pkgs, ... }:
};

services.xserver.displayManager.lightdm.background = ../assets/wallpapers/akira.png;
console.font = "${pkgs.terminus_font}/share/consolefonts/ter-u24n.psf.gz";
# console.font = "${pkgs.terminus_font}/share/consolefonts/ter-u24n.psf.gz";
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";

fileSystems."/" = {
Expand Down
55 changes: 55 additions & 0 deletions users/ksevelyar/laundry/alacritty-scratchpad.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
window:
opacity: 0.94
dynamic_title: true
padding:
x: 10
y: 10

font:
size: 12.0
normal:
family: Terminus
style: Regular

bold:
style: Bold

italic:
style: Regular

bold_italic:
style: Bold

cursor:
style: Underline

colors:
primary:
background: '#1b161f'
foreground: '#f8f8f2'

cursor:
text: '#44475a'
cursor: '#ffce50'

normal:
black: '#000000'
red: '#ff5555'
green: '#54c6b5'
yellow: '#d5aa2a'
blue: '#bd93f9'
magenta: '#ff79c6'
cyan: '#8be9fd'
white: '#bfbfbf'

bright:
black: '#1b161f'
red: '#ff6e67'
green: '#5af78e'
yellow: '#ffce50'
blue: '#caa9fa'
magenta: '#ff92d0'
cyan: '#9aedfe'
white: '#e6e6e6'

draw_bold_text_with_bright_colors: true
53 changes: 53 additions & 0 deletions users/ksevelyar/laundry/alacritty.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
font:
size: 12.0
normal:
family: Terminus
style: Regular

bold:
style: Bold

italic:
style: Regular

bold_italic:
style: Bold


window:
opacity: 0.94
dynamic_title: true

cursor:
style: Underline

colors:
primary:
background: '#1b161f'
foreground: '#f8f8f2'

cursor:
text: '#44475a'
cursor: '#ffce50'

normal:
black: '#000000'
red: '#ff5555'
green: '#54c6b5'
yellow: '#d5aa2a'
blue: '#bd93f9'
magenta: '#ff79c6'
cyan: '#8be9fd'
white: '#bfbfbf'

bright:
black: '#1b161f'
red: '#ff6e67'
green: '#5af78e'
yellow: '#ffce50'
blue: '#caa9fa'
magenta: '#ff92d0'
cyan: '#9aedfe'
white: '#e6e6e6'

draw_bold_text_with_bright_colors: true
184 changes: 184 additions & 0 deletions users/ksevelyar/laundry/polybar
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
[global/wm]
margin-top = 0
margin-bottom = 0

[settings]
screenchange-reload = true

[colors]
background = #d0303030
background-transparent = #00303030
background-alt = #0f0f0f
background-alt-2 = #ff5fafcf
foreground = #BEB3CD
foreground-alt = #c1c2c3
violet = #5b51c9

[bar/base]
font-0 = Terminus:size=14;0
font-1 = Siji:size=14;1
font-2 = IPAGothic:size=12;2

width = 100%
height = 24
offset-x = 0
offset-y = 0
fixed-center = true

background = ${colors.background-alt}
foreground = ${colors.foreground}

overline-size = 0
underline-size = 0

border-bottom-size = 0
border-bottom-color = #ffffff
module-margin-left = 1
module-margin-right = 1

radius = 0.0

border-size = 0
border-color = #00000000

tray-position = none
padding-left = 1
padding-right = 1

[bar/bottom]
inherit = bar/base
bottom = true

modules-left = leftwm
modules-center = title
modules-right = date

[module/leftwm]
type = custom/script
exec = leftwm-state -w 0 -t ~/.config/leftwm/themes/current/template.liquid
tail = true

[bar/top]
inherit = bar/base
bottom = false
font-0 = Terminus:size=16;2
font-1 = Siji:size=16;1
height = 22

modules-left = volume
modules-center = filesystem
modules-right = vpn vnc ssh network battery

# ls -l /sys/class/power_supply
[module/battery]
type = internal/battery
battery = BAT1
adapter = AC
full-at = 98
format-charging = %{F#9c71C7}%{F-} <label-charging>
format-full = %{F#9c71C7}%{F-} <label-full>
time-format = %H:%M
label-discharging = %{F#9c71C7}%{F-} %percentage%% %{F#6B5A68}%time%%{F-}
format-discharging = <label-discharging>

[module/title]
type = internal/xwindow
label-maxlen = 170

[module/vnc]
type = custom/script
exec-if = pgrep x11vnc
exec = echo "$(lsof -Pni | grep x11vnc | grep -v LISTEN | wc -l)"
format-prefix = "%{F#FF79C6} vnc%{F-} "
click-right = pkill x11vnc
interval = 1

[module/vpn]
type = custom/script
exec = ~/.config/polybar/vpn.fish
format-prefix = "%{F#FF79C6} %{F-} "
click-left = sudo systemctl stop openvpn-uk-shark.service
interval = 2

[module/ssh]
type = custom/script
exec-if = pgrep sshd
exec = echo "$(who | grep pts | wc -l)"
format-prefix = "%{F#FF79C6} ssh%{F-} "
click-right = systemctl stop sshd
interval = 1

[module/weather]
type = custom/script
exec = ~/.config/polybar/weather.sh
interval = 300

[module/spotify]
type = custom/script
exec-if = pgrep -f spotify
exec = ~/.config/polybar/spotify.sh
interval = 1
format-foreground = #6B5A68
click-left = playerctl -p spotify play-pause spotify &
click-right = playerctl -p spotify next spotify &

[module/mpd]
type = custom/script
exec = mpc current
interval = 1
format-foreground = #6B5A68
click-left = mpc toggle
click-right = mpc next

[module/filesystem]
type = internal/fs
interval = 2

mount-0 = /
label-mounted = %{F#9c71C7}%mountpoint%%{F-} %free%
label-unmounted =
label-unmounted-foreground = ${colors.foreground}

[module/cpu]
type = internal/cpu
interval = 1
format-prefix = " %{F#9c71C7}%{F-}"
format-prefix-foreground = ${colors.foreground}
label = %percentage:3%%

[module/memory]
type = internal/memory
interval = 1
format-prefix = "%{F#9c71C7}%{F-}"
format-prefix-foreground = ${colors.foreground}
label = %percentage_used:3%%

[module/network]
type = internal/network
interface = wlp0s20f3
interval = 1.0
label-connected = %{A1:sh ~/.config/polybar/local_and_public_ips.sh:} %{F#9c71C7}%{F-}%downspeed:8% %{F#9c71C7}%{F-}%upspeed:8%%{A}

[module/date]
type = internal/date
interval = 1

date = " %A %B %d"
time = %H:%M

format-prefix = "%{F#9c71C7}%{F-}"
format-prefix-foreground = ${colors.foreground}

label = %{F#6B5A68}%date%%{F-}  %time%

[module/volume]
type = internal/pulseaudio
interval = 1

label-volume = "%{F#9c71C7} %{F-}%percentage%%"
label-volume-foreground = ${root.foreground}

format-muted-prefix = "%{F#9c71C7}%{F-} "
format-muted-foreground = #6B5A68

; vim: set ft=dosini:

0 comments on commit 7c0c8f8

Please sign in to comment.