From 7c0c8f8cc9670c58c5f163d4a8cb320085deb0d8 Mon Sep 17 00:00:00 2001 From: Sergey Zubkov Date: Sun, 17 Sep 2023 23:20:00 +0300 Subject: [PATCH] update polybar & alacritty for hosts/laundry --- hosts/laundry.nix | 8 +- .../laundry/alacritty-scratchpad.yml | 55 ++++++ users/ksevelyar/laundry/alacritty.yml | 53 +++++ users/ksevelyar/laundry/polybar | 184 ++++++++++++++++++ 4 files changed, 299 insertions(+), 1 deletion(-) create mode 100644 users/ksevelyar/laundry/alacritty-scratchpad.yml create mode 100644 users/ksevelyar/laundry/alacritty.yml create mode 100644 users/ksevelyar/laundry/polybar diff --git a/hosts/laundry.nix b/hosts/laundry.nix index 65bd7a3..c6f1c89 100644 --- a/hosts/laundry.nix +++ b/hosts/laundry.nix @@ -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; @@ -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."/" = { diff --git a/users/ksevelyar/laundry/alacritty-scratchpad.yml b/users/ksevelyar/laundry/alacritty-scratchpad.yml new file mode 100644 index 0000000..cebaedb --- /dev/null +++ b/users/ksevelyar/laundry/alacritty-scratchpad.yml @@ -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 diff --git a/users/ksevelyar/laundry/alacritty.yml b/users/ksevelyar/laundry/alacritty.yml new file mode 100644 index 0000000..0a6d35e --- /dev/null +++ b/users/ksevelyar/laundry/alacritty.yml @@ -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 diff --git a/users/ksevelyar/laundry/polybar b/users/ksevelyar/laundry/polybar new file mode 100644 index 0000000..3a58b36 --- /dev/null +++ b/users/ksevelyar/laundry/polybar @@ -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-} +format-full = %{F#9c71C7}%{F-} +time-format = %H:%M +label-discharging = %{F#9c71C7}%{F-} %percentage%% %{F#6B5A68}%time%%{F-} +format-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: