First commit
This commit is contained in:
7
modules/desktop/X11/polybar/config/colors.ini
Normal file
7
modules/desktop/X11/polybar/config/colors.ini
Normal file
@@ -0,0 +1,7 @@
|
||||
[colors]
|
||||
background = #cc303446
|
||||
background-alt = #21252b
|
||||
foreground = #c6d0f5
|
||||
primary = #8caaee
|
||||
alert = #e78284
|
||||
disabled = #b5bfe2
|
||||
218
modules/desktop/X11/polybar/config/config.ini
Normal file
218
modules/desktop/X11/polybar/config/config.ini
Normal file
@@ -0,0 +1,218 @@
|
||||
;==========================================================
|
||||
;
|
||||
;
|
||||
; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗
|
||||
; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
|
||||
; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝
|
||||
; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗
|
||||
; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║
|
||||
; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
|
||||
;
|
||||
;
|
||||
; To learn more about how to configure Polybar
|
||||
; go to https://github.com/polybar/polybar
|
||||
;
|
||||
; The README contains a lot of information
|
||||
;
|
||||
;==========================================================
|
||||
|
||||
include-file = colors.ini
|
||||
include-file = screen.ini
|
||||
|
||||
[module/separator]
|
||||
type = custom/text
|
||||
|
||||
format = <label>
|
||||
format-padding = 6px
|
||||
|
||||
label = |
|
||||
|
||||
[module/arch]
|
||||
type = custom/text
|
||||
|
||||
format = <label>
|
||||
|
||||
label = ""
|
||||
label-font = 2
|
||||
label-padding-right = 5px
|
||||
label-foreground = ${colors.primary}
|
||||
|
||||
click-left = ~/.config/polybar/disconnect.sh
|
||||
|
||||
[module/systray]
|
||||
type = internal/tray
|
||||
|
||||
format-margin = 0px
|
||||
tray-spacing = 5px
|
||||
tray-padding = 0px
|
||||
tray-size = 90%
|
||||
|
||||
[module/i3]
|
||||
type = internal/i3
|
||||
|
||||
pin-workspaces = true
|
||||
show-urgent = true
|
||||
enable-scroll = false
|
||||
|
||||
format = <label-state>
|
||||
|
||||
label-focused = %name%
|
||||
label-focused-background = ${colors.background-alt}
|
||||
label-focused-underline= ${colors.primary}
|
||||
label-focused-padding = 15px
|
||||
|
||||
label-unfocused = %name%
|
||||
label-unfocused-background = ${colors.background-alt}
|
||||
label-unfocused-padding = 15px
|
||||
|
||||
label-urgent = %name%
|
||||
label-urgent-background = ${colors.alert}
|
||||
label-urgent-padding = 15px
|
||||
|
||||
label-separator = " "
|
||||
label-separator-padding = 0px
|
||||
label-separator-foreground = #ffb52a
|
||||
|
||||
[module/filesystemprefix]
|
||||
type = custom/text
|
||||
|
||||
format = <label>
|
||||
fotmat-font = 1
|
||||
format-foreground=${colors.primary}
|
||||
|
||||
label = " "
|
||||
label-font = 2
|
||||
label-padding-right = 10px
|
||||
|
||||
[module/filesystem]
|
||||
type = internal/fs
|
||||
interval = 25
|
||||
|
||||
mount-0 = /
|
||||
label-mounted = %{F8caaee}%{F-}%percentage_used%%
|
||||
label-mounted-font = 1
|
||||
|
||||
label-unmounted = %mountpoint% not mounted
|
||||
label-unmounted-foreground = ${colors.disabled}
|
||||
|
||||
[module/pulseaudio]
|
||||
type = internal/pulseaudio
|
||||
|
||||
format-volume = <label-volume>
|
||||
format-volume-prefix = " "
|
||||
format-volume-prefix-font = 3
|
||||
format-volume-prefix-padding-right = 5px
|
||||
format-volume-prefix-foreground = ${colors.primary}
|
||||
|
||||
label-volume = "%percentage%%"
|
||||
label-volume-font = 1
|
||||
|
||||
label-muted = %{F#8caaee}%{F-} mute
|
||||
|
||||
[module/xkeyboard]
|
||||
type = internal/xkeyboard
|
||||
blacklist-0 = num lock
|
||||
|
||||
label-layout = %layout%
|
||||
label-layout-foreground = ${colors.primary}
|
||||
|
||||
label-indicator-foreground = ${colors.background}
|
||||
label-indicator-background = ${colors.primary}
|
||||
|
||||
[module/memory]
|
||||
type = internal/memory
|
||||
interval = 2
|
||||
format-prefix = " "
|
||||
format-prefix-font = 3
|
||||
format-prefix-foreground = ${colors.primary}
|
||||
label = %percentage_used:2%%
|
||||
|
||||
[module/cpu]
|
||||
type = internal/cpu
|
||||
interval = 2
|
||||
format-prefix = " "
|
||||
format-prefix-font = 2
|
||||
format-prefix-padding-right = 8px
|
||||
format-prefix-foreground = ${colors.primary}
|
||||
label = %percentage%%
|
||||
|
||||
[module/eth]
|
||||
type = internal/network
|
||||
interface-type = wired
|
||||
interval = 5
|
||||
format-connected = <label-connected>
|
||||
format-connected-prefix = " "
|
||||
format-connected-prefix-font = 2
|
||||
format-connected-prefix-padding-right = 8px
|
||||
format-connected-prefix-foreground = ${colors.primary}
|
||||
|
||||
label-connected = %ifname% %local_ip%
|
||||
|
||||
[module/ethspeed]
|
||||
type = internal/network
|
||||
interface-type = wired
|
||||
interval = 5
|
||||
format-connected = <label-connected>
|
||||
format-connected-prefix = " "
|
||||
format-connected-prefix-font = 3
|
||||
format-connected-prefix-padding-right = 5px
|
||||
format-connected-prefix-foreground = ${colors.primary}
|
||||
label-connected = %downspeed% %upspeed%
|
||||
|
||||
[module/pacman]
|
||||
type = custom/script
|
||||
exec = pacman -Syup | head -n -4 | wc -l
|
||||
interval = 600
|
||||
|
||||
format = <label>
|
||||
format-prefix = " "
|
||||
format-prefix-font = 2
|
||||
format-prefix-padding-right = 5px
|
||||
format-prefix-foreground=${colors.primary}
|
||||
|
||||
[module/watchdog]
|
||||
type = custom/script
|
||||
exec = /etc/xdg/polybar/mailbox.sh count
|
||||
interval = 30
|
||||
|
||||
format = <label>
|
||||
#format-prefix = "✗ "
|
||||
format-prefix = " "
|
||||
format-prefix-font = 2
|
||||
format-prefix-padding-right = 5px
|
||||
format-prefix-foreground=${colors.primary}
|
||||
|
||||
format-fail = <label-fail>
|
||||
format-fail-prefix = "✗ "
|
||||
format-fail-prefix-font = 0
|
||||
format-fail-prefix-foreground=${colors.alert}
|
||||
|
||||
click-left = /etc/xdg/polybar/mailbox.sh fetch
|
||||
|
||||
[module/dateprefix]
|
||||
type = custom/text
|
||||
|
||||
format = <label>
|
||||
format-foreground=${colors.primary}
|
||||
|
||||
label = " "
|
||||
label-font = 3
|
||||
label-padding-right = 5px
|
||||
|
||||
click-left = ~/.config/polybar/calendar.sh
|
||||
|
||||
[module/date]
|
||||
type = internal/date
|
||||
interval = 1.0
|
||||
|
||||
date = %a %Y-%m-%d %H:%M
|
||||
date-alt = %H:%M:%S
|
||||
|
||||
format = <label>
|
||||
|
||||
label = %date%
|
||||
label-padding-right = 10px
|
||||
|
||||
[settings]
|
||||
screenchange-reload = true
|
||||
pseudo-transparency = false
|
||||
4
modules/desktop/X11/polybar/config/imap_creds.example
Normal file
4
modules/desktop/X11/polybar/config/imap_creds.example
Normal file
@@ -0,0 +1,4 @@
|
||||
_USER="jeremie.salvi@gmail.com"
|
||||
_PASSWD="mystrongpasswd"
|
||||
_SERVER="gmail.com"
|
||||
_FOLDER="Admin"
|
||||
35
modules/desktop/X11/polybar/config/mailbox.sh
Executable file
35
modules/desktop/X11/polybar/config/mailbox.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
cd -- "$(dirname -- "$0")"
|
||||
_DIRNAME="$(pwd)"
|
||||
|
||||
source ~/.config/polybar/imap_creds
|
||||
|
||||
if [[ -n $1 ]] && [[ $1 == "count" ]]
|
||||
then
|
||||
_COUNT=$(curl -u "$_USER:$_PASSWD" "imaps://$_SERVER" -X "STATUS $_FOLDER (UNSEEN)" 2>/dev/null | \
|
||||
sed -e 's/)\r//' -e 's/.*UNSEEN //')
|
||||
printf "%s" "$_COUNT"
|
||||
(( _COUNT == 0 )) && exit 0
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -n $1 ]] && [[ $1 == "fetch" ]]
|
||||
then
|
||||
_UNSEEN="$(curl -u \""$_USER":"$_PASSWD"\" "imaps://$_SERVER/$_FOLDER" -X "SEARCH UNSEEN" 2>/dev/null | \
|
||||
sed -e "s/\\r//" -e "s/* SEARCH //" -e "s/ /,/g")"
|
||||
_MAILS=$(curl -v -u "$_USER:$_PASSWD" "imaps://$_SERVER/$_FOLDER" -X "FETCH $_UNSEEN BODY.PEEK[HEADER.FIELDS (From Subject)]" 2>&1 | \
|
||||
grep -E "From:|Subject:" | sed -e 's/< //' -e 's/Subject/\nSubject/')
|
||||
dunstify -I ../icons/gmail.svg \
|
||||
"" "$_MAILS"
|
||||
printf "%s" "$_MAILS"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
cat <<EOF
|
||||
Usage:
|
||||
mailbox.sh count => Count unseen mails in $_FOLDER
|
||||
mailbox.sh fetch => Fetch "From:" and "Subject:" from unseen mails in $_FOLDER
|
||||
EOF
|
||||
63
modules/desktop/X11/polybar/config/screen-home-nix.ini
Normal file
63
modules/desktop/X11/polybar/config/screen-home-nix.ini
Normal file
@@ -0,0 +1,63 @@
|
||||
[bar/main]
|
||||
monitor = HDMI-1
|
||||
|
||||
width = 100%
|
||||
height = 30px
|
||||
radius = 0
|
||||
|
||||
background = ${colors.background}
|
||||
foreground = ${colors.foreground}
|
||||
|
||||
line-size = 3px
|
||||
|
||||
border-size = 0pt
|
||||
|
||||
padding-left = 10px
|
||||
padding-right = 0px
|
||||
|
||||
font-0 = ComicShannsMono Nerd Font:size=14;2
|
||||
font-1 = ComicShannsMono Nerd Font:size=14;1
|
||||
font-2 = ComicShannsMono Nerd Font:size=14;0
|
||||
font-3 = DejaVuSansM Nerd Font:size=14;0
|
||||
|
||||
fixed-center = true
|
||||
modules-left = arch separator cpu separator memory separator filesystemprefix filesystem separator eth separator ethspeed separator pulseaudio
|
||||
modules-center = i3
|
||||
modules-right = watchdog separator pacman separator xkeyboard separator dateprefix date systray
|
||||
|
||||
cursor-click = pointer
|
||||
cursor-scroll = ns-resize
|
||||
|
||||
enable-ipc = true
|
||||
|
||||
[bar/alt]
|
||||
monitor = HDMI-0
|
||||
|
||||
width = 100%
|
||||
height = 30px
|
||||
radius = 0
|
||||
|
||||
background = ${colors.background}
|
||||
foreground = ${colors.foreground}
|
||||
|
||||
line-size = 3px
|
||||
|
||||
border-size = 0pt
|
||||
|
||||
padding-left = 10px
|
||||
padding-right = 0px
|
||||
|
||||
font-0 = ComicShannsMono Nerd Font:size=14;2
|
||||
font-1 = ComicShannsMono Nerd Font:size=14;1
|
||||
font-2 = ComicShannsMono Nerd Font:size=14;0
|
||||
font-3 = DejaVuSansM Nerd Font:size=14;0
|
||||
|
||||
fixed-center = true
|
||||
modules-left = arch separator cpu separator memory separator filesystemprefix filesystem separator eth separator ethspeed separator pulseaudio
|
||||
modules-center = i3
|
||||
modules-right = xkeyboard separator dateprefix date
|
||||
|
||||
cursor-click = pointer
|
||||
cursor-scroll = ns-resize
|
||||
|
||||
enable-ipc = true
|
||||
31
modules/desktop/X11/polybar/config/screen-test-kvm.ini
Normal file
31
modules/desktop/X11/polybar/config/screen-test-kvm.ini
Normal file
@@ -0,0 +1,31 @@
|
||||
[bar/main]
|
||||
monitor =
|
||||
|
||||
width = 100%
|
||||
height = 30px
|
||||
radius = 0
|
||||
|
||||
background = ${colors.background}
|
||||
foreground = ${colors.foreground}
|
||||
|
||||
line-size = 3px
|
||||
|
||||
border-size = 0pt
|
||||
|
||||
padding-left = 10px
|
||||
padding-right = 0px
|
||||
|
||||
font-0 = ComicShannsMono Nerd Font:size=14;2
|
||||
font-1 = ComicShannsMono Nerd Font:size=14;1
|
||||
font-2 = ComicShannsMono Nerd Font:size=14;0
|
||||
font-3 = DejaVuSansM Nerd Font:size=14;0
|
||||
|
||||
fixed-center = true
|
||||
modules-left = arch separator cpu separator memory separator filesystemprefix filesystem separator eth separator ethspeed separator pulseaudio
|
||||
modules-center = i3
|
||||
modules-right = watchdog separator pacman separator xkeyboard separator dateprefix date systray
|
||||
|
||||
cursor-click = pointer
|
||||
cursor-scroll = ns-resize
|
||||
|
||||
enable-ipc = true
|
||||
18
modules/desktop/X11/polybar/default.nix
Normal file
18
modules/desktop/X11/polybar/default.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}@attrs:
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
polybarFull
|
||||
];
|
||||
environment.etc = {
|
||||
"xdg/polybar/config.ini".source = ./config/config.ini;
|
||||
"xdg/polybar/colors.ini".source = ./config/colors.ini;
|
||||
"xdg/polybar/screen.ini".source = ./config/screen-${attrs.hostname}.ini;
|
||||
"xdg/polybar/mailbox.sh".source = ./config/mailbox.sh;
|
||||
"xdg/polybar/imap_creds.example".source = ./config/imap_creds.example;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user