Skip to content

Commit

Permalink
Replace i3bar with polybar.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cribac committed Jun 25, 2022
1 parent dc188eb commit aaae616
Show file tree
Hide file tree
Showing 3 changed files with 186 additions and 65 deletions.
68 changes: 3 additions & 65 deletions .config/i3/config
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ exec --no-startup-id ~/set_once_i3.sh
# config starts here: #
#######################

# Launch polybar
exec_always --no-startup-id $HOME/.config/polybar/launch.sh

# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
# This font is widely installed, provides lots of unicode glyphs, right-to-left
Expand Down Expand Up @@ -474,71 +477,6 @@ client.unfocused $darkblue $darkblue $grey $purple $darkgrey
client.focused_inactive $darkblue $darkblue $grey $purple $black
client.urgent $urgentred $urgentred $white $purple $yellowbrown

############################################
# bar settings (input comes from i3blocks) #
############################################

# Start i3bar to display a workspace bar
# (plus the system information i3status finds out, if available)
bar {
font pango:Noto Sans Regular 12, FontAwesome 12
status_command i3blocks -c ~/.config/i3/i3blocks.conf
position top
# i3bar_command i3bar --transparency
# it could be that you have no primary display set: set one (xrandr --output <output> --primary)
# reference: https://i3wm.org/docs/userguide.html#_tray_output
tray_output primary
tray_padding 0

# When strip_workspace_numbers is set to yes,
# any workspace that has a name of the form
# “[n][:][NAME]” will display only the name.
strip_workspace_numbers yes
##strip_workspace_name no

colors {
separator $purple
background $darkgrey
statusline $white
# border bg txt indicator
focused_workspace $mediumgrey $grey $darkgrey $purple
active_workspace $lightblue $mediumgrey $darkgrey $purple
inactive_workspace $darkgrey $darkgrey $grey $purple
urgent_workspace $urgentred $urgentred $white $purple
}
}

# you can add different bars for multidisplay setups on each display:
# set output HDMI-0 to the display you want the bar, --transparency can be set.
# Transparency needs rgba color codes to be used where the last two letters are the transparency factor see here:
# https://gist.github.com/lopspower/03fb1cc0ac9f32ef38f4
# #08052be6 --> e6=90%

# bar {
# font pango:Noto Sans Regular 9, FontAwesome 9
# status_command i3blocks -c ~/.config/i3/i3blocks-2.conf
# i3bar_command i3bar --transparency
# output HDMI-0
# position bottom
#
# When strip_workspace_numbers is set to yes,
# any workspace that has a name of the form
# “[n][:][NAME]” will display only the name.
#strip_workspace_numbers yes
##strip_workspace_name no
#
# colors {
# separator $purple
# background $darkbluetrans
# statusline $white
# border bg txt indicator
# focused_workspace $lighterblue $lighterblue $darkblue $purple
# active_workspace $lightdblue $lightdblue $darkblue $purple
# inactive_workspace $darkblue $darkblue $lightdblue $purple
# urgent_workspace $urgentred $urgentred $white $purple
# }
#}

#####################################
# Application menu handled by rofi: #
#####################################
Expand Down
172 changes: 172 additions & 0 deletions .config/polybar/config.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
;==========================================================
;
;
; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗
; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝
; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗
; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║
; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
;
;
; 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/cribac]
width = 100%
height = 24pt
radius = 6

; dpi = 96

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

line-size = 3pt

border-size = 4pt
border-color = #00000000

padding-left = 0
padding-right = 1

module-margin = 1

separator = |
separator-foreground = ${colors.disabled}

font-0 = monospace;2

modules-left = xworkspaces xwindow
modules-right = filesystem pulseaudio xkeyboard memory cpu wlan eth date

cursor-click = pointer
cursor-scroll = ns-resize

enable-ipc = true

; tray-position = right

; wm-restack = generic
; wm-restack = bspwm
; wm-restack = i3

; override-redirect = true

[module/xworkspaces]
type = internal/xworkspaces

label-active = %name%
label-active-background = ${colors.background-alt}
label-active-underline= ${colors.primary}
label-active-padding = 1

label-occupied = %name%
label-occupied-padding = 1

label-urgent = %name%
label-urgent-background = ${colors.alert}
label-urgent-padding = 1

label-empty = %name%
label-empty-foreground = ${colors.disabled}
label-empty-padding = 1

[module/xwindow]
type = internal/xwindow
label = %title:0:60:...%

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

mount-0 = /

label-mounted = %{F#F0C674}%mountpoint%%{F-} %percentage_used%%

label-unmounted = %mountpoint% not mounted
label-unmounted-foreground = ${colors.disabled}

[module/pulseaudio]
type = internal/pulseaudio

format-volume-prefix = "VOL "
format-volume-prefix-foreground = ${colors.primary}
format-volume = <label-volume>

label-volume = %percentage%%

label-muted = muted
label-muted-foreground = ${colors.disabled}

[module/xkeyboard]
type = internal/xkeyboard
blacklist-0 = num lock

label-layout = %layout%
label-layout-foreground = ${colors.primary}

label-indicator-padding = 2
label-indicator-margin = 1
label-indicator-foreground = ${colors.background}
label-indicator-background = ${colors.secondary}

[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#F0C674}%ifname%%{F-} %essid% %local_ip%

[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-alt = %Y-%m-%d %H:%M:%S

label = %date%
label-foreground = ${colors.primary}

[settings]
screenchange-reload = true
pseudo-transparency = true

; vim:ft=dosini
11 changes: 11 additions & 0 deletions .config/polybar/launch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

# Polybar launch script
#
# Nuke already running instances of polybar
killall -q polybar

# Launch bar called cribac
echo "---" | tee -a /tmp/polybar_cribac.log
polybar cribac 2>&1 | tee -a /tmp/polybar_cribac.log & disown
echo "Polybar cribac launched..."

0 comments on commit aaae616

Please sign in to comment.