Implement custom separators
This commit is contained in:
@@ -5,13 +5,214 @@
|
|||||||
// Default backbround color. If not set value of #edeceb is used.
|
// Default backbround color. If not set value of #edeceb is used.
|
||||||
"background" : "#000000",
|
"background" : "#000000",
|
||||||
|
|
||||||
// Load Average
|
"separator" : {
|
||||||
"la" : true,
|
"left": {
|
||||||
|
"enabled": true,
|
||||||
|
"color": "#3e78fd",
|
||||||
|
"background": "#000000",
|
||||||
|
"symbol": "▶",
|
||||||
|
"font": "Noto Sans",
|
||||||
|
// ‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’, or a percentage (e.g. ‘200%’), or
|
||||||
|
// one of the relative sizes ‘smaller’ or ‘larger’
|
||||||
|
"font_size": "medium"
|
||||||
|
},
|
||||||
|
|
||||||
|
"right": {
|
||||||
|
// False if value omitted
|
||||||
|
"enabled": true,
|
||||||
|
// Used #edeceb as default if value omitted
|
||||||
|
"color": "#3e78fd",
|
||||||
|
// If not set #3e78fd is used.
|
||||||
|
"background": "#000000",
|
||||||
|
// If omitted, used "|" (no quotes) as default
|
||||||
|
"symbol": "◀",
|
||||||
|
"font": "Noto Sans",
|
||||||
|
// ‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’, or a percentage (e.g. ‘200%’), or
|
||||||
|
// one of the relative sizes ‘smaller’ or ‘larger’
|
||||||
|
"font_size": "medium"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// Memory stats
|
// Memory stats
|
||||||
"mem" : {
|
"mem" : {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"show_swap": false
|
"show_swap": false,
|
||||||
|
|
||||||
|
"separator" : {
|
||||||
|
"left": {
|
||||||
|
"enabled": true,
|
||||||
|
"color": "#3e78fd",
|
||||||
|
"background": "#000000",
|
||||||
|
"symbol": "▶",
|
||||||
|
"font": "Noto Sans",
|
||||||
|
// ‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’, or a percentage (e.g. ‘200%’), or
|
||||||
|
// one of the relative sizes ‘smaller’ or ‘larger’
|
||||||
|
"font_size": "medium"
|
||||||
|
},
|
||||||
|
|
||||||
|
"right": {
|
||||||
|
"enabled": true,
|
||||||
|
"color": "#3e78fd",
|
||||||
|
"background": "#000000",
|
||||||
|
"symbol": "◀",
|
||||||
|
"font": "Noto Sans",
|
||||||
|
// ‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’, or a percentage (e.g. ‘200%’), or
|
||||||
|
// one of the relative sizes ‘smaller’ or ‘larger’
|
||||||
|
"font_size": "medium"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// Load Average
|
||||||
|
"la" : {
|
||||||
|
"enabled": true,
|
||||||
|
|
||||||
|
"separator" : {
|
||||||
|
"left": {
|
||||||
|
"enabled": true,
|
||||||
|
"color": "#3e78fd",
|
||||||
|
"background": "#000000",
|
||||||
|
"symbol": "▶",
|
||||||
|
"font": "Noto Sans",
|
||||||
|
// ‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’, or a percentage (e.g. ‘200%’), or
|
||||||
|
// one of the relative sizes ‘smaller’ or ‘larger’
|
||||||
|
"font_size": "medium"
|
||||||
|
},
|
||||||
|
|
||||||
|
"right": {
|
||||||
|
"enabled": true,
|
||||||
|
"color": "#3e78fd",
|
||||||
|
"background": "#000000",
|
||||||
|
"symbol": "◀",
|
||||||
|
"font": "Noto Sans",
|
||||||
|
// ‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’, or a percentage (e.g. ‘200%’), or
|
||||||
|
// one of the relative sizes ‘smaller’ or ‘larger’
|
||||||
|
"font_size": "medium"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"net-if" : {
|
||||||
|
"enabled" : false,
|
||||||
|
// In html notation
|
||||||
|
"down_color" : "red",
|
||||||
|
"up_color" : "green",
|
||||||
|
|
||||||
|
"separator" : {
|
||||||
|
"left": {
|
||||||
|
"enabled": true,
|
||||||
|
"color": "#3e78fd",
|
||||||
|
"symbol": "▶",
|
||||||
|
"font": "Noto Sans",
|
||||||
|
// ‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’, or a percentage (e.g. ‘200%’), or
|
||||||
|
// one of the relative sizes ‘smaller’ or ‘larger’
|
||||||
|
"font_size": "medium"
|
||||||
|
},
|
||||||
|
|
||||||
|
"right": {
|
||||||
|
"enabled": true,
|
||||||
|
"color": "#3e78fd",
|
||||||
|
"background": "#000000",
|
||||||
|
"symbol": "◀",
|
||||||
|
"font": "Noto Sans",
|
||||||
|
// ‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’, or a percentage (e.g. ‘200%’), or
|
||||||
|
// one of the relative sizes ‘smaller’ or ‘larger’
|
||||||
|
"font_size": "medium"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"if" : [
|
||||||
|
{
|
||||||
|
// Name as it displayed on i3bar
|
||||||
|
"name" : "eth0",
|
||||||
|
// Directory containing net if status files
|
||||||
|
"dir" : "/sys/class/net/eth0"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
// OpenVPN status. Note that directive status in openvpn.conf should point to
|
||||||
|
// state file and *update* its timestamp at least as frequent as mtime_threshold in seconds
|
||||||
|
"vpn": {
|
||||||
|
"enabled": false,
|
||||||
|
"statusfile" : "/tmp/openvpn-status.stat",
|
||||||
|
"mtime_threshold": 10,
|
||||||
|
// Color in html notation
|
||||||
|
"down_color" : "red",
|
||||||
|
"up_color" : "green",
|
||||||
|
|
||||||
|
"separator" : {
|
||||||
|
"left": {
|
||||||
|
"enabled": true,
|
||||||
|
"color": "#3e78fd",
|
||||||
|
"background": "#000000",
|
||||||
|
"symbol": "▶",
|
||||||
|
"font": "Noto Sans",
|
||||||
|
// ‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’, or a percentage (e.g. ‘200%’), or
|
||||||
|
// one of the relative sizes ‘smaller’ or ‘larger’
|
||||||
|
"font_size": "medium"
|
||||||
|
},
|
||||||
|
|
||||||
|
"right": {
|
||||||
|
"enabled": true,
|
||||||
|
"color": "#3e78fd",
|
||||||
|
"background": "#000000",
|
||||||
|
"symbol": "◀",
|
||||||
|
"font": "Noto Sans",
|
||||||
|
// ‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’, or a percentage (e.g. ‘200%’), or
|
||||||
|
// one of the relative sizes ‘smaller’ or ‘larger’
|
||||||
|
"font_size": "medium"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// Also we can tcp-ping some service inside vpn network to ensure that connection is not stoned
|
||||||
|
"tcp_check" : {
|
||||||
|
"enabled": false,
|
||||||
|
"host": "somehost.tld",
|
||||||
|
"port": 443,
|
||||||
|
"timeout" : 3
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// Simple sound volume indicator
|
||||||
|
"simple-volume-pa": {
|
||||||
|
"enabled": false,
|
||||||
|
"symbol": "🔊",
|
||||||
|
// If not defined - will be "true"
|
||||||
|
"right_click_cmd": ["pavucontrol"],
|
||||||
|
// Change volume step in %, if not configured it is 5
|
||||||
|
"step": 3,
|
||||||
|
// We'll change volume level with mouse wheel. Under X11 it is mapped to some buttons, typically 4 and 5 (z-axis).
|
||||||
|
// If omited, default value is 4
|
||||||
|
"wheel_up": 4,
|
||||||
|
// If omited, default value is 5
|
||||||
|
"wheel_down": 5,
|
||||||
|
// Maximum sound volume, can be over 100%, but sould not be :) Default value 100 if not set.
|
||||||
|
"max_volume_limit": 120,
|
||||||
|
|
||||||
|
"separator" : {
|
||||||
|
"left": {
|
||||||
|
"enabled": true,
|
||||||
|
"color": "#3e78fd",
|
||||||
|
"background": "#000000",
|
||||||
|
"symbol": "▶",
|
||||||
|
"font": "Noto Sans",
|
||||||
|
// ‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’, or a percentage (e.g. ‘200%’), or
|
||||||
|
// one of the relative sizes ‘smaller’ or ‘larger’
|
||||||
|
"font_size": "medium"
|
||||||
|
},
|
||||||
|
|
||||||
|
"right": {
|
||||||
|
"enabled": true,
|
||||||
|
"color": "#3e78fd",
|
||||||
|
"background": "#000000",
|
||||||
|
"symbol": "◀",
|
||||||
|
"font": "Noto Sans",
|
||||||
|
// ‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’, or a percentage (e.g. ‘200%’), or
|
||||||
|
// one of the relative sizes ‘smaller’ or ‘larger’
|
||||||
|
"font_size": "medium"
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Just clock
|
// Just clock
|
||||||
@@ -20,6 +221,30 @@
|
|||||||
// Text color in html (actually, pango) notation
|
// Text color in html (actually, pango) notation
|
||||||
"color" : "#666666",
|
"color" : "#666666",
|
||||||
|
|
||||||
|
"separator" : {
|
||||||
|
"left": {
|
||||||
|
"enabled": true,
|
||||||
|
"color": "#3e78fd",
|
||||||
|
"background": "#000000",
|
||||||
|
"symbol": "▶",
|
||||||
|
"font": "Noto Sans",
|
||||||
|
// ‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’, or a percentage (e.g. ‘200%’), or
|
||||||
|
// one of the relative sizes ‘smaller’ or ‘larger’
|
||||||
|
"font_size": "medium"
|
||||||
|
},
|
||||||
|
|
||||||
|
"right": {
|
||||||
|
"enabled": true,
|
||||||
|
"color": "#3e78fd",
|
||||||
|
"background": "#000000",
|
||||||
|
"symbol": "◀",
|
||||||
|
"font": "Noto Sans",
|
||||||
|
// ‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’, or a percentage (e.g. ‘200%’), or
|
||||||
|
// one of the relative sizes ‘smaller’ or ‘larger’
|
||||||
|
"font_size": "medium"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
"left_click" : {
|
"left_click" : {
|
||||||
"enabled" : false,
|
"enabled" : false,
|
||||||
// cmd is array of command itself and its arguments
|
// cmd is array of command itself and its arguments
|
||||||
@@ -42,6 +267,30 @@
|
|||||||
"empty": "red",
|
"empty": "red",
|
||||||
"almost_full": "yellow",
|
"almost_full": "yellow",
|
||||||
"almost_empty": "orange"
|
"almost_empty": "orange"
|
||||||
|
},
|
||||||
|
|
||||||
|
"separator" : {
|
||||||
|
"left": {
|
||||||
|
"enabled": true,
|
||||||
|
"color": "#3e78fd",
|
||||||
|
"background": "#000000",
|
||||||
|
"symbol": "▶",
|
||||||
|
"font": "Noto Sans",
|
||||||
|
// ‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’, or a percentage (e.g. ‘200%’), or
|
||||||
|
// one of the relative sizes ‘smaller’ or ‘larger’
|
||||||
|
"font_size": "medium"
|
||||||
|
},
|
||||||
|
|
||||||
|
"right": {
|
||||||
|
"enabled": true,
|
||||||
|
"color": "#3e78fd",
|
||||||
|
"background": "#000000",
|
||||||
|
"symbol": "◀",
|
||||||
|
"font": "Noto Sans",
|
||||||
|
// ‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’, or a percentage (e.g. ‘200%’), or
|
||||||
|
// one of the relative sizes ‘smaller’ or ‘larger’
|
||||||
|
"font_size": "medium"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -49,6 +298,30 @@
|
|||||||
"cpu_temp": {
|
"cpu_temp": {
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
|
|
||||||
|
"separator" : {
|
||||||
|
"left": {
|
||||||
|
"enabled": true,
|
||||||
|
"color": "#3e78fd",
|
||||||
|
"background": "#000000",
|
||||||
|
"symbol": "▶",
|
||||||
|
"font": "Noto Sans",
|
||||||
|
// ‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’, or a percentage (e.g. ‘200%’), or
|
||||||
|
// one of the relative sizes ‘smaller’ or ‘larger’
|
||||||
|
"font_size": "medium"
|
||||||
|
},
|
||||||
|
|
||||||
|
"right": {
|
||||||
|
"enabled": true,
|
||||||
|
"color": "#3e78fd",
|
||||||
|
"background": "#000000",
|
||||||
|
"symbol": "◀",
|
||||||
|
"font": "Noto Sans",
|
||||||
|
// ‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’, or a percentage (e.g. ‘200%’), or
|
||||||
|
// one of the relative sizes ‘smaller’ or ‘larger’
|
||||||
|
"font_size": "medium"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// Files in sysfs that contains cpu temperatures
|
// Files in sysfs that contains cpu temperatures
|
||||||
"file": [
|
"file": [
|
||||||
"/sys/class/hwmon/hwmon4/temp2_input",
|
"/sys/class/hwmon/hwmon4/temp2_input",
|
||||||
@@ -60,58 +333,6 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
// OpenVPN status. Note that directive status in openvpn.conf should point to
|
|
||||||
// state file and *update* its timestamp at least as frequent as mtime_threshold in seconds
|
|
||||||
"vpn": {
|
|
||||||
"enabled": false,
|
|
||||||
"statusfile" : "/tmp/openvpn-status.stat",
|
|
||||||
"mtime_threshold": 10,
|
|
||||||
// Color in html notation
|
|
||||||
"down_color" : "red",
|
|
||||||
"up_color" : "green",
|
|
||||||
// Also we can tcp-ping some service inside vpn network to ensure that connection is not stoned
|
|
||||||
|
|
||||||
"tcp_check" : {
|
|
||||||
"enabled": false,
|
|
||||||
"host": "somehost.tld",
|
|
||||||
"port": 443,
|
|
||||||
"timeout" : 3
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// Simple sound volume indicator
|
|
||||||
"simple-volume-pa": {
|
|
||||||
"enabled": false,
|
|
||||||
"symbol": "🔊",
|
|
||||||
// If not defined - will be "true"
|
|
||||||
"right_click_cmd": ["pavucontrol"],
|
|
||||||
// Change volume step in %, if not configured it is 5
|
|
||||||
"step": 3,
|
|
||||||
// We'll change volume level with mouse wheel. Under X11 it is mapped to some buttons, typically 4 and 5 (z-axis).
|
|
||||||
// If omited, default value is 4
|
|
||||||
"wheel_up": 4,
|
|
||||||
// If omited, default value is 5
|
|
||||||
"wheel_down": 5,
|
|
||||||
// Maximum sound volume, can be over 100%, but sould not be :) Default value 100 if not set.
|
|
||||||
"max_volume_limit": 120
|
|
||||||
},
|
|
||||||
|
|
||||||
"net-if" : {
|
|
||||||
"enabled" : false,
|
|
||||||
// In html notation
|
|
||||||
"down_color" : "red",
|
|
||||||
"up_color" : "green",
|
|
||||||
|
|
||||||
"if" : [
|
|
||||||
{
|
|
||||||
// Name as it displayed on i3bar
|
|
||||||
"name" : "eth0",
|
|
||||||
// Directory containing net if status files
|
|
||||||
"dir" : "/sys/class/net/eth0"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
|
|
||||||
// Intended mainly for use with desktop notifications
|
// Intended mainly for use with desktop notifications
|
||||||
// Because it inherits all env vars from i3, it can intercat with dbus and other
|
// Because it inherits all env vars from i3, it can intercat with dbus and other
|
||||||
// such user session services.
|
// such user session services.
|
||||||
@@ -138,7 +359,31 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
// Weather to display Application Buttons
|
// Weather to display Application Buttons
|
||||||
"app_buttons": true,
|
"app_buttons": {
|
||||||
|
"enabled": true,
|
||||||
|
|
||||||
|
"separator" : {
|
||||||
|
"left": {
|
||||||
|
"enabled": true,
|
||||||
|
"color": "#3e78fd",
|
||||||
|
"symbol": "▶",
|
||||||
|
"font": "Noto Sans",
|
||||||
|
// ‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’, or a percentage (e.g. ‘200%’), or
|
||||||
|
// one of the relative sizes ‘smaller’ or ‘larger’
|
||||||
|
"font_size": "medium"
|
||||||
|
},
|
||||||
|
|
||||||
|
"right": {
|
||||||
|
"enabled": true,
|
||||||
|
"color": "#3e78fd",
|
||||||
|
"symbol": "◀",
|
||||||
|
"font": "Noto Sans",
|
||||||
|
// ‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’, or a percentage (e.g. ‘200%’), or
|
||||||
|
// one of the relative sizes ‘smaller’ or ‘larger’
|
||||||
|
"font_size": "medium"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// Buttons - application launch "buttons"
|
// Buttons - application launch "buttons"
|
||||||
"apps": [
|
"apps": [
|
||||||
|
|||||||
255
main.go
255
main.go
@@ -59,7 +59,7 @@ func main() {
|
|||||||
go ParseStdin()
|
go ParseStdin()
|
||||||
go CleanZombies()
|
go CleanZombies()
|
||||||
|
|
||||||
if Conf.AppButtons {
|
if Conf.AppButtons.Enabled {
|
||||||
go UpdateI3WinList()
|
go UpdateI3WinList()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Populate LA stats
|
// Populate LA stats
|
||||||
if Conf.LA {
|
if Conf.LA.Enabled {
|
||||||
go UpdateLaStats()
|
go UpdateLaStats()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,11 +131,33 @@ func main() {
|
|||||||
// Actually build json struct, marshal it and print result
|
// Actually build json struct, marshal it and print result
|
||||||
var j []I3BarOutBlock
|
var j []I3BarOutBlock
|
||||||
|
|
||||||
if Conf.AppButtons {
|
// TODO: впилить для первого и последнего батона separator
|
||||||
for _, app := range Conf.Apps {
|
if Conf.AppButtons.Enabled {
|
||||||
|
for num, app := range Conf.Apps {
|
||||||
var b I3BarOutBlock
|
var b I3BarOutBlock
|
||||||
|
|
||||||
|
if num == 0 {
|
||||||
|
b.FullText = fmt.Sprintf(
|
||||||
|
"<span color='%s' background='%s' size='%s'>%s</span>",
|
||||||
|
Conf.AppButtons.Separator.Left.Color,
|
||||||
|
Conf.AppButtons.Separator.Left.Background,
|
||||||
|
Conf.AppButtons.Separator.Left.FontSize,
|
||||||
|
Conf.AppButtons.Separator.Left.Symbol,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
b.FullText = app.FullText
|
b.FullText = app.FullText
|
||||||
|
|
||||||
|
if num == len(Conf.Apps) {
|
||||||
|
b.FullText = fmt.Sprintf(
|
||||||
|
"<span color='%s' background='%s' size='%s'>%s</span>",
|
||||||
|
Conf.AppButtons.Separator.Right.Color,
|
||||||
|
Conf.AppButtons.Separator.Right.Background,
|
||||||
|
Conf.AppButtons.Separator.Right.FontSize,
|
||||||
|
Conf.AppButtons.Separator.Right.Symbol,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
b.Background = app.Background
|
b.Background = app.Background
|
||||||
b.Color = app.Color
|
b.Color = app.Color
|
||||||
b.Instance = app.Instance
|
b.Instance = app.Instance
|
||||||
@@ -156,71 +178,256 @@ func main() {
|
|||||||
|
|
||||||
if Conf.CPUTemp.Enabled {
|
if Conf.CPUTemp.Enabled {
|
||||||
var b I3BarOutBlock
|
var b I3BarOutBlock
|
||||||
b.FullText = fmt.Sprintf("CPU: %d°", CPUTemperature)
|
|
||||||
b.Separator = true
|
if Conf.CPUTemp.Separator.Left.Enabled {
|
||||||
|
b.FullText = fmt.Sprintf(
|
||||||
|
"<span color='%s' background='%s' size='%s'>%s</span>",
|
||||||
|
Conf.CPUTemp.Separator.Left.Color,
|
||||||
|
Conf.CPUTemp.Separator.Left.Background,
|
||||||
|
Conf.CPUTemp.Separator.Left.FontSize,
|
||||||
|
Conf.CPUTemp.Separator.Left.Symbol,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
b.FullText += fmt.Sprintf("CPU: %d°", CPUTemperature)
|
||||||
|
|
||||||
|
if Conf.CPUTemp.Separator.Right.Enabled {
|
||||||
|
b.FullText += fmt.Sprintf(
|
||||||
|
"<span color='%s' background='%s' size='%s'>%s</span>",
|
||||||
|
Conf.CPUTemp.Separator.Right.Color,
|
||||||
|
Conf.CPUTemp.Separator.Right.Background,
|
||||||
|
Conf.CPUTemp.Separator.Right.FontSize,
|
||||||
|
Conf.CPUTemp.Separator.Right.Symbol,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
b.Markup = "pango"
|
||||||
|
b.Separator = false
|
||||||
|
|
||||||
j = append(j, b)
|
j = append(j, b)
|
||||||
}
|
}
|
||||||
|
|
||||||
if Conf.Mem.Enabled {
|
if Conf.Mem.Enabled {
|
||||||
var b I3BarOutBlock
|
var b I3BarOutBlock
|
||||||
|
|
||||||
if Conf.Mem.ShowSwap {
|
if Conf.Mem.Separator.Left.Enabled {
|
||||||
b.FullText = fmt.Sprintf("M:%d%% SHM:%dM SW:%dM", Memory.Usedpct, Memory.Shared, Memory.Swap)
|
b.FullText = fmt.Sprintf(
|
||||||
} else {
|
"<span color='%s' background='%s' size='%s'>%s</span>",
|
||||||
b.FullText = fmt.Sprintf("M:%d%% SHM:%dM", Memory.Usedpct, Memory.Shared)
|
Conf.Mem.Separator.Left.Color,
|
||||||
|
Conf.Mem.Separator.Left.Background,
|
||||||
|
Conf.Mem.Separator.Left.FontSize,
|
||||||
|
Conf.Mem.Separator.Left.Symbol,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
b.Separator = true
|
if Conf.Mem.ShowSwap {
|
||||||
|
b.FullText += fmt.Sprintf("M:%d%% SHM:%dM SW:%dM", Memory.Usedpct, Memory.Shared, Memory.Swap)
|
||||||
|
} else {
|
||||||
|
b.FullText += fmt.Sprintf("M:%d%% SHM:%dM", Memory.Usedpct, Memory.Shared)
|
||||||
|
}
|
||||||
|
|
||||||
|
if Conf.Mem.Separator.Right.Enabled {
|
||||||
|
b.FullText += fmt.Sprintf(
|
||||||
|
"<span color='%s' background='%s' size='%s'>%s</span>",
|
||||||
|
Conf.Mem.Separator.Right.Color,
|
||||||
|
Conf.Mem.Separator.Right.Background,
|
||||||
|
Conf.Mem.Separator.Right.FontSize,
|
||||||
|
Conf.Mem.Separator.Right.Symbol,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
b.Markup = "pango"
|
||||||
|
b.Separator = false
|
||||||
|
|
||||||
j = append(j, b)
|
j = append(j, b)
|
||||||
}
|
}
|
||||||
|
|
||||||
if Conf.LA {
|
if Conf.LA.Enabled {
|
||||||
var b I3BarOutBlock
|
var b I3BarOutBlock
|
||||||
b.FullText = fmt.Sprintf("La: %s", La)
|
|
||||||
b.Separator = true
|
if Conf.LA.Separator.Left.Enabled {
|
||||||
|
b.FullText = fmt.Sprintf(
|
||||||
|
"<span color='%s' background='%s' size='%s'>%s</span>",
|
||||||
|
Conf.LA.Separator.Left.Color,
|
||||||
|
Conf.LA.Separator.Left.Background,
|
||||||
|
Conf.LA.Separator.Left.FontSize,
|
||||||
|
Conf.LA.Separator.Left.Symbol,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
b.FullText += fmt.Sprintf("LA: %s", La)
|
||||||
|
|
||||||
|
if Conf.LA.Separator.Right.Enabled {
|
||||||
|
b.FullText += fmt.Sprintf(
|
||||||
|
"<span color='%s' background='%s' size='%s'>%s</span>",
|
||||||
|
Conf.LA.Separator.Right.Color,
|
||||||
|
Conf.LA.Separator.Right.Background,
|
||||||
|
Conf.LA.Separator.Right.FontSize,
|
||||||
|
Conf.LA.Separator.Right.Symbol,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
b.Markup = "pango"
|
||||||
|
b.Separator = false
|
||||||
|
|
||||||
j = append(j, b)
|
j = append(j, b)
|
||||||
}
|
}
|
||||||
|
|
||||||
if Conf.NetIf.Enabled {
|
if Conf.NetIf.Enabled {
|
||||||
var b I3BarOutBlock
|
var b I3BarOutBlock
|
||||||
b.FullText = IfStatus
|
|
||||||
|
if Conf.NetIf.Separator.Left.Enabled {
|
||||||
|
b.FullText = fmt.Sprintf(
|
||||||
|
"<span color='%s' background='%s' size='%s'>%s</span>",
|
||||||
|
Conf.NetIf.Separator.Left.Color,
|
||||||
|
Conf.NetIf.Separator.Left.Background,
|
||||||
|
Conf.NetIf.Separator.Left.FontSize,
|
||||||
|
Conf.NetIf.Separator.Left.Symbol,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
b.FullText += IfStatus
|
||||||
|
|
||||||
|
if Conf.NetIf.Separator.Right.Enabled {
|
||||||
|
b.FullText += fmt.Sprintf(
|
||||||
|
"<span color='%s' background='%s' size='%s'>%s</span>",
|
||||||
|
Conf.NetIf.Separator.Right.Color,
|
||||||
|
Conf.NetIf.Separator.Right.Background,
|
||||||
|
Conf.NetIf.Separator.Right.FontSize,
|
||||||
|
Conf.NetIf.Separator.Right.Symbol,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
b.Markup = "pango"
|
b.Markup = "pango"
|
||||||
b.Separator = true
|
b.Separator = false
|
||||||
|
|
||||||
j = append(j, b)
|
j = append(j, b)
|
||||||
}
|
}
|
||||||
|
|
||||||
if Conf.Vpn.Enabled {
|
if Conf.Vpn.Enabled {
|
||||||
var b I3BarOutBlock
|
var b I3BarOutBlock
|
||||||
b.FullText = VPNStatus
|
|
||||||
|
if Conf.Vpn.Separator.Left.Enabled {
|
||||||
|
b.FullText = fmt.Sprintf(
|
||||||
|
"<span color='%s' background='%s' size='%s'>%s</span>",
|
||||||
|
Conf.Vpn.Separator.Left.Color,
|
||||||
|
Conf.Vpn.Separator.Left.Background,
|
||||||
|
Conf.Vpn.Separator.Left.FontSize,
|
||||||
|
Conf.Vpn.Separator.Left.Symbol,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
b.FullText += VPNStatus
|
||||||
|
|
||||||
|
if Conf.Vpn.Separator.Right.Enabled {
|
||||||
|
b.FullText += fmt.Sprintf(
|
||||||
|
"<span color='%s' background='%s' size='%s'>%s</span>",
|
||||||
|
Conf.Vpn.Separator.Right.Color,
|
||||||
|
Conf.Vpn.Separator.Right.Background,
|
||||||
|
Conf.Vpn.Separator.Right.FontSize,
|
||||||
|
Conf.Vpn.Separator.Right.Symbol,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
b.Markup = "pango"
|
b.Markup = "pango"
|
||||||
b.Separator = true
|
b.Separator = false
|
||||||
|
|
||||||
j = append(j, b)
|
j = append(j, b)
|
||||||
}
|
}
|
||||||
|
|
||||||
if Conf.Battery.Enabled {
|
if Conf.Battery.Enabled {
|
||||||
var b I3BarOutBlock
|
var b I3BarOutBlock
|
||||||
b.FullText = Batt
|
|
||||||
b.Separator = true
|
if Conf.Battery.Separator.Left.Enabled {
|
||||||
|
b.FullText = fmt.Sprintf(
|
||||||
|
"<span color='%s' background='%s' size='%s'>%s</span>",
|
||||||
|
Conf.Battery.Separator.Left.Color,
|
||||||
|
Conf.Battery.Separator.Left.Background,
|
||||||
|
Conf.Battery.Separator.Left.FontSize,
|
||||||
|
Conf.Battery.Separator.Left.Symbol,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
b.FullText += Batt
|
||||||
|
|
||||||
|
if Conf.Battery.Separator.Right.Enabled {
|
||||||
|
b.FullText += fmt.Sprintf(
|
||||||
|
"<span color='%s' background='%s' size='%s'>%s</span>",
|
||||||
|
Conf.Battery.Separator.Right.Color,
|
||||||
|
Conf.Battery.Separator.Right.Background,
|
||||||
|
Conf.Battery.Separator.Right.FontSize,
|
||||||
|
Conf.Battery.Separator.Right.Symbol,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
b.Markup = "pango"
|
||||||
|
b.Separator = false
|
||||||
|
|
||||||
j = append(j, b)
|
j = append(j, b)
|
||||||
}
|
}
|
||||||
|
|
||||||
if Conf.SimpleVolumePa.Enabled {
|
if Conf.SimpleVolumePa.Enabled {
|
||||||
var b I3BarOutBlock
|
var b I3BarOutBlock
|
||||||
b.Name = "simple-volume-pa"
|
b.Name = "simple-volume-pa"
|
||||||
b.FullText = SoundVolume
|
|
||||||
|
if Conf.SimpleVolumePa.Separator.Left.Enabled {
|
||||||
|
b.FullText = fmt.Sprintf(
|
||||||
|
"<span color='%s' background='%s' size='%s'>%s</span>",
|
||||||
|
Conf.SimpleVolumePa.Separator.Left.Color,
|
||||||
|
Conf.SimpleVolumePa.Separator.Left.Background,
|
||||||
|
Conf.SimpleVolumePa.Separator.Left.FontSize,
|
||||||
|
Conf.SimpleVolumePa.Separator.Left.Symbol,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
b.FullText += SoundVolume
|
||||||
|
|
||||||
|
if Conf.SimpleVolumePa.Separator.Right.Enabled {
|
||||||
|
b.FullText += fmt.Sprintf(
|
||||||
|
"<span color='%s' background='%s' size='%s'>%s</span>",
|
||||||
|
Conf.SimpleVolumePa.Separator.Right.Color,
|
||||||
|
Conf.SimpleVolumePa.Separator.Right.Background,
|
||||||
|
Conf.SimpleVolumePa.Separator.Right.FontSize,
|
||||||
|
Conf.SimpleVolumePa.Separator.Right.Symbol,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
b.Markup = "pango"
|
b.Markup = "pango"
|
||||||
b.Separator = true
|
b.Separator = false
|
||||||
|
|
||||||
j = append(j, b)
|
j = append(j, b)
|
||||||
}
|
}
|
||||||
|
|
||||||
if Conf.Clock.Enabled {
|
if Conf.Clock.Enabled {
|
||||||
var b I3BarOutBlock
|
var b I3BarOutBlock
|
||||||
b.Name = `wallclock`
|
b.Name = `wallclock`
|
||||||
b.FullText = Clock
|
|
||||||
|
if Conf.Clock.Separator.Left.Enabled {
|
||||||
|
b.FullText = fmt.Sprintf(
|
||||||
|
"<span color='%s' background='%s' size='%s'>%s</span>",
|
||||||
|
Conf.Clock.Separator.Left.Color,
|
||||||
|
Conf.Clock.Separator.Left.Background,
|
||||||
|
Conf.Clock.Separator.Left.FontSize,
|
||||||
|
Conf.Clock.Separator.Left.Symbol,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
b.FullText += Clock
|
||||||
|
|
||||||
|
if Conf.Clock.Separator.Right.Enabled {
|
||||||
|
b.FullText += fmt.Sprintf(
|
||||||
|
"<span color='%s' background='%s' size='%s'>%s</span>",
|
||||||
|
Conf.Clock.Separator.Right.Color,
|
||||||
|
Conf.Clock.Separator.Right.Background,
|
||||||
|
Conf.Clock.Separator.Right.FontSize,
|
||||||
|
Conf.Clock.Separator.Right.Symbol,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
b.Markup = "pango"
|
b.Markup = "pango"
|
||||||
b.Color = Conf.Clock.Color
|
b.Color = Conf.Clock.Color
|
||||||
b.Separator = true
|
b.Separator = false
|
||||||
|
|
||||||
j = append(j, b)
|
j = append(j, b)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user