feat: Add polybar

This commit is contained in:
2024-10-14 20:39:34 +11:00
parent effbd481e5
commit 67c7567f71
4 changed files with 250 additions and 10 deletions

View File

@@ -1,7 +1,7 @@
import = ["~/.config/alacritty/themes/themes/hyper.toml"]
[shell]
program = "/home/nathan/.local/bin/zellij"
program = "/home/nathan/.cargo/bin/zellij"
[env]
TERM = "xterm-256color"
@@ -10,12 +10,13 @@ shell = "zsh"
[window]
decorations = "none"
opacity = 1
opacity = 5
blur = true
# padding = { x = 10, y = 10 }
[font]
normal = { family = "Fira Code", style = "Regular" }
size = 6.5
[selection]
save_to_clipboard = true

220
.config/polybar/config.ini Normal file
View File

@@ -0,0 +1,220 @@
;==========================================================
;
;
; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗
; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝
; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗
; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║
; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
;
;
; To learn more about how to configure Polybar
; go to https://github.com/polybar/polybar
;
; The README contains a lot of information
;
;==========================================================
[colors]
background = #282A2E
background-alt = #373B41
foreground = #C5C8C6
primary = #F0C674
secondary = #8ABEB7
alert = #A54242
disabled = #707880
[bar/default]
width = 100%
height = 24pt
radius = 6
; dpi = 96
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3pt
; border-size = 4pt
border-color = #000000
padding-left = 2
padding-right = 2
module-margin = 1
separator = ""
separator-foreground = ${colors.disabled}
font-0 = monospace;2
; Import Firacode nerd fonts
font-1 = FiraCode Nerd Font Mono:size=15;2
; Add Noto Color Emoji for emoji support
font-2 = Noto Color Emoji:fontformat=truetype:scale=10:antialias=false;2
modules-left = music message
modules-right = filesystem memory cpu wlan tailscale eth battery bluetooth date
cursor-click = pointer
cursor-scroll = ns-resize
enable-ipc = true
bottom = false
; wm-restack = generic
; wm-restack = bspwm
; wm-restack = i3
; override-redirect = true
[module/message]
type = custom/ipc
hook-0 = cat /tmp/message
hook-1 = echo "" > /tmp/message
format = <output>
format-padding = 5
format-foreground = #FFFFFF
format-background = #000000
label = %output%
click-left = "#message.hook.1"
[module/music-controls]
type = custom/ipc
hook-0 = echo ""
hook-1 = /home/nathan/scripts/music.sh p
hook-2 = /home/nathan/scripts/music.sh prev
hook-3 = /home/nathan/scripts/music.sh next
initial = 1
format = <label>
label = "%{A1:#music-controls.hook.2:}󰒮%{A} %{A1:#music-controls.hook.1:}󰐎%{A} %{A1:#music-controls.hook.3:}󰒭%{A}"
[module/filesystem]
type = internal/fs
interval = 25
mount-0 = /
label-mounted = %{F#F0C674}%mountpoint%%{F-} %percentage_used%% Disk
label-unmounted = %mountpoint% not mounted
label-unmounted-foreground = ${colors.disabled}
label-warn = %{F#F0C674}%mountpoint%%{F#FF0000} disk full
[module/memory]
type = internal/memory
interval = 2
format-prefix = "RAM "
format-prefix-foreground = ${colors.primary}
label = %percentage_used:2%%
[module/cpu]
type = internal/cpu
interval = 2
format-prefix = "CPU "
format-prefix-foreground = ${colors.primary}
label = %percentage:2%% |
[network-base]
type = internal/network
interval = 5
format-connected = <label-connected>
format-disconnected = <label-disconnected>
label-disconnected = %{F#F0C674}%ifname%%{F#707880} disconnected
[module/wlan]
inherit = network-base
interface-type = wireless
label-connected = %{F#00FF00}󱚿%{F-} %essid%
label-disconnected = %{F#FF0000}󰖪%{F-} %{F#F0C674}%ifname%%{F#707880} disconnected
; %local_ip% %netspeed%
[module/tailscale]
type = custom/script
exec = /home/nathan/scripts/ts.sh short color
format = <label> |
click-left = /home/nathan/scripts/ts.sh en toggle
interval = 1
[module/music]
type = custom/script
exec = /home/nathan/scripts/music.sh
interval = 1
[module/battery]
type = internal/battery
low-at = 15
format-charging = <ramp-capacity> <label-charging> %{F#ff60d090}<animation-charging>%{F-}
format-discharging = <ramp-capacity> <label-discharging> <animation-discharging>
format-full = %{F#00FF00}%{F-} <label-full>
format-low = <label-low> <animation-low>
label-charging = %percentage%%
label-discharging = %percentage%%
label-full = %percentage%%
label-low =  %percentage%%
ramp-capacity-0 =
ramp-capacity-1 =
ramp-capacity-2 =
ramp-capacity-3 =
ramp-capacity-4 =
bar-capacity-width = 10
animation-charging-0 =
animation-charging-1 =
animation-charging-2 =
animation-charging-3 =
animation-charging-4 =
animation-charging-framerate = 750
animation-discharging-0 =
animation-discharging-1 =
animation-discharging-2 =
animation-discharging-3 =
animation-discharging-4 =
animation-discharging-framerate = 500
animation-low-0 = !
animation-low-1 = " "
animation-low-framerate = 500
[module/eth]
inherit = network-base
interface-type = wired
label-connected = %{F#F0C674}%ifname%%{F-} %local_ip%
[module/date]
type = internal/date
interval = 1
; date = %H:%M
date = %Y-%m-%d %r
label = %date%
label-foreground = ${colors.primary}
[module/bluetooth]
type = custom/script
exec = /home/nathan/scripts/bt.sh colour
interval = 5
click-left = /home/nathan/scripts/bt.sh toggle
format = | <label>
[settings]
screenchange-reload = true
pseudo-transparency = true

17
.zshrc
View File

@@ -103,7 +103,7 @@ export EDITOR=nano
export VISUAL=nano
eval "$(oh-my-posh init zsh --config ~/theme.omp.json)"
#eval "$(oh-my-posh init zsh --config ~/theme.omp.json)"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
@@ -133,6 +133,7 @@ alias ls='exa'
alias ll='exa --long --group --header --icons --classify'
eval "$(zoxide init --cmd cd zsh)"
eval "$(oh-my-posh init zsh --config ~/theme.omp.json)"
export HSD_API_KEY=30e7b7974d99c62b241a9daf3d4924a108515b03
alias z='zellij'
@@ -142,6 +143,18 @@ alias opacity='/home/nathan/scripts/opacity.sh'
alias op='/home/nathan/scripts/opacity.sh'
alias blur='/home/nathan/scripts/blur.sh'
alias music='/home/nathan/scripts/music.sh'
alias venv='source /home/nathan/scripts/venv.sh'
alias copy='/home/nathan/scripts/copy.sh'
alias upload='/home/nathan/scripts/upload.sh'
alias ts='/home/nathan/scripts/ts.sh'
alias hold='/home/nathan/scripts/hold.sh'
alias message='/home/nathan/scripts/message.sh'
unzip() {
/usr/bin/unzip -d "${1%.*}" "$1"
}
. "$HOME/.atuin/bin/env"
@@ -151,3 +164,5 @@ eval "$(atuin init zsh --disable-up-arrow)"
bindkey '^[[1;5A' atuin-up-search
fpath+=${ZDOTDIR:-~}/.zsh_functions
# Tailscale autocomplete

View File

@@ -22,10 +22,12 @@
"type": "python",
"style": "plain",
"foreground": "yellow",
"template": "<{{ if .Root }}lightBlue{{ else }}green{{ end }}>-[</>\ue235 {{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }}{{ end }}{{ .Full }}{{ end }}<{{ if .Root }}lightBlue{{ else }}green{{ end }}>]</>",
"template": "<{{ if .Root }}lightBlue{{ else }}green{{ end }}>-[</> {{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }} {{ end }}(v{{ .Full }}){{ end }}<{{ if .Root }}lightBlue{{ else }}green{{ end }}>]</>",
"properties": {
"fetch_version": false,
"fetch_virtual_env": true
"fetch_version": true,
"fetch_virtual_env": true,
"display_version": true,
"display_mode": "context"
}
},
{
@@ -56,12 +58,13 @@
"foreground": "white",
"template": " {{ .FormattedMs }} ",
"properties": {
"always_enabled": true,
"always_enabled": false,
"threshold": 50,
"style": "round"
}
},
{
"type": "exit",
"type": "executiontime",
"style": "plain",
"foreground": "green",
"foreground_templates": [
@@ -69,7 +72,8 @@
],
"template": " {{ if gt .Code 0 }}\u2a2f{{else}}✓{{ end }} ",
"properties": {
"always_enabled": true
"always_enabled": false,
"threshold": 50
}
}
]