Bug fixes, custom config
This commit is contained in:
@@ -19,7 +19,7 @@ dependencies = {
|
|||||||
"netifaces": False,
|
"netifaces": False,
|
||||||
}
|
}
|
||||||
|
|
||||||
icons_path = "icons_light" # "icons_light", "icons_dark" or "" (GTK icons)
|
icons_path = "" # "icons_light", "icons_dark" or "" (GTK icons)
|
||||||
|
|
||||||
commands = {
|
commands = {
|
||||||
"get_battery": "upower -i $(upower -e | grep BAT) | grep --color=never -E 'state|to\\\\ full|to\\\\ empty|percentage'",
|
"get_battery": "upower -i $(upower -e | grep BAT) | grep --color=never -E 'state|to\\\\ full|to\\\\ empty|percentage'",
|
||||||
|
@@ -1,158 +1,27 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"output": "eDP-1",
|
"output": "",
|
||||||
"layer": "bottom",
|
|
||||||
"position": "bottom",
|
|
||||||
"width": 1920,
|
|
||||||
"height": 30,
|
|
||||||
"margin-top": 0,
|
|
||||||
"margin-bottom": 0,
|
|
||||||
"padding-horizontal": 10,
|
|
||||||
"padding-vertical": 0,
|
|
||||||
"spacing": 4,
|
|
||||||
"items-padding": 0,
|
|
||||||
"css-name": "all-bottom",
|
|
||||||
"focus": true,
|
|
||||||
"modules-left": [
|
|
||||||
"sway-taskbar"
|
|
||||||
],
|
|
||||||
"modules-center": [],
|
|
||||||
"modules-right": [
|
|
||||||
"executor-cpuav",
|
|
||||||
"executor-cpubar",
|
|
||||||
"executor-temp",
|
|
||||||
"executor-memory",
|
|
||||||
"executor-drives",
|
|
||||||
"executor-uptime"
|
|
||||||
|
|
||||||
],
|
|
||||||
"sway-taskbar": {
|
|
||||||
"workspace-buttons": false,
|
|
||||||
"show-app-icon": true,
|
|
||||||
"show-layout": true,
|
|
||||||
"show-app-name": true,
|
|
||||||
"name-max-len": 15,
|
|
||||||
"workspaces-spacing": 0,
|
|
||||||
"task-spacing": 0,
|
|
||||||
"all-outputs": false
|
|
||||||
},
|
|
||||||
"sway-workspaces": {
|
|
||||||
"numbers": [3, 4]
|
|
||||||
},
|
|
||||||
"executor-cpubar": {
|
|
||||||
"script": "psuinfo -Cg",
|
|
||||||
"interval": 2
|
|
||||||
},
|
|
||||||
"executor-cpuav": {
|
|
||||||
"script": "psuinfo -Ca",
|
|
||||||
"interval": 2
|
|
||||||
},
|
|
||||||
"executor-temp": {
|
|
||||||
"script": "psuinfo -It",
|
|
||||||
"interval": 5
|
|
||||||
},
|
|
||||||
"executor-memory": {
|
|
||||||
"script": "psuinfo -IM",
|
|
||||||
"interval": 5
|
|
||||||
},
|
|
||||||
"executor-drives": {
|
|
||||||
"script": "psuinfo -IN",
|
|
||||||
"interval": 15
|
|
||||||
},
|
|
||||||
"executor-uptime": {
|
|
||||||
"script": "psuinfo -Iu",
|
|
||||||
"interval": 60
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"output": "DP-1",
|
|
||||||
"layer": "top",
|
|
||||||
"position": "bottom",
|
|
||||||
"width": 1920,
|
|
||||||
"height": 30,
|
|
||||||
"margin-top": 0,
|
|
||||||
"margin-bottom": 0,
|
|
||||||
"padding-horizontal": 4,
|
|
||||||
"padding-vertical": 0,
|
|
||||||
"spacing": 6,
|
|
||||||
"css-name": "all-bottom",
|
|
||||||
"modules-left": [
|
|
||||||
"sway-taskbar"
|
|
||||||
],
|
|
||||||
"modules-center": [],
|
|
||||||
"modules-right": ["executor-traffic"],
|
|
||||||
"sway-taskbar": {
|
|
||||||
"workspace-buttons": false,
|
|
||||||
"show-app-icon": true,
|
|
||||||
"show-layout": true,
|
|
||||||
"show-app-name": true,
|
|
||||||
"name-max-len": 20,
|
|
||||||
"workspaces-spacing": 0,
|
|
||||||
"task-spacing": 0,
|
|
||||||
"all-outputs": false
|
|
||||||
},
|
|
||||||
"sway-workspaces": {
|
|
||||||
"numbers": [1, 2]
|
|
||||||
},
|
|
||||||
"executor-traffic": {
|
|
||||||
"script": "psuinfo -Ik",
|
|
||||||
"interval": 3
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"output": "HDMI-A-1",
|
|
||||||
"layer": "top",
|
|
||||||
"position": "bottom",
|
|
||||||
"width": 1920,
|
|
||||||
"height": 30,
|
|
||||||
"margin-top": 0,
|
|
||||||
"margin-bottom": 0,
|
|
||||||
"padding-horizontal": 4,
|
|
||||||
"padding-vertical": 0,
|
|
||||||
"spacing": 6,
|
|
||||||
"css-name": "all-bottom",
|
|
||||||
"modules-left": [
|
|
||||||
"sway-taskbar"
|
|
||||||
],
|
|
||||||
"modules-center": [],
|
|
||||||
"modules-right": [],
|
|
||||||
"sway-taskbar": {
|
|
||||||
"workspace-buttons": false,
|
|
||||||
"show-app-icon": true,
|
|
||||||
"show-layout": true,
|
|
||||||
"show-app-name": true,
|
|
||||||
"name-max-len": 20,
|
|
||||||
"workspaces-spacing": 0,
|
|
||||||
"task-spacing": 0,
|
|
||||||
"all-outputs": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"output": "eDP-1",
|
|
||||||
"layer": "bottom",
|
"layer": "bottom",
|
||||||
"position": "top",
|
"position": "top",
|
||||||
"width": 1920,
|
|
||||||
"height": 30,
|
"height": 30,
|
||||||
"homogeneous": true,
|
"homogeneous": true,
|
||||||
"margin-top": 0,
|
"margin-top": 0,
|
||||||
"margin-bottom": 0,
|
"margin-bottom": 0,
|
||||||
"padding-horizontal": 0,
|
"padding-horizontal": 0,
|
||||||
"padding-vertical": 0,
|
"padding-vertical": 0,
|
||||||
"spacing": 4,
|
"spacing": 0,
|
||||||
"controls": true,
|
|
||||||
"items-padding": 0,
|
"items-padding": 0,
|
||||||
"css-name": "primary-top",
|
"css-name": "primary-top",
|
||||||
"icons": "light",
|
"icons": "light",
|
||||||
|
"controls": true,
|
||||||
"modules-left": [
|
"modules-left": [
|
||||||
"button-grid",
|
"playerctl"
|
||||||
"playerctl"
|
|
||||||
|
|
||||||
],
|
],
|
||||||
"modules-center": [
|
"modules-center": [
|
||||||
"executor-weather",
|
"executor-weather",
|
||||||
"clock"
|
"clock"
|
||||||
],
|
],
|
||||||
"modules-right": ["executor-github", "executor-arch"],
|
"modules-right": [],
|
||||||
"sway-taskbar": {
|
"sway-taskbar": {
|
||||||
"workspace-buttons": false,
|
"workspace-buttons": false,
|
||||||
"show-app-icon": true,
|
"show-app-icon": true,
|
||||||
@@ -165,70 +34,136 @@
|
|||||||
},
|
},
|
||||||
"controls-settings": {
|
"controls-settings": {
|
||||||
"alignment": "right",
|
"alignment": "right",
|
||||||
|
"show-values": false,
|
||||||
|
"interval": 1,
|
||||||
|
"icon-size": 16,
|
||||||
|
"hover-opens": true,
|
||||||
|
"css-name": "controls-window",
|
||||||
|
"net-interface": "wlo1",
|
||||||
"components": [
|
"components": [
|
||||||
"net",
|
"net",
|
||||||
"brightness",
|
"brightness",
|
||||||
"volume",
|
"volume",
|
||||||
|
"bluetooth",
|
||||||
"battery"
|
"battery"
|
||||||
],
|
],
|
||||||
"commands": {
|
"commands": {
|
||||||
"battery": "",
|
"net": "",
|
||||||
"net": ""
|
"bluetooth": "",
|
||||||
|
"battery": ""
|
||||||
},
|
},
|
||||||
"custom-items": [
|
"custom-items": [
|
||||||
{ "name": "Wallpapers", "icon": "azote", "cmd": "azote" },
|
{
|
||||||
{ "name": "Look & Feel", "icon": "preferences-desktop-theme", "cmd": "lxappearance" }
|
"name": "Wallpapers",
|
||||||
|
"icon": "azote",
|
||||||
|
"cmd": "azote"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Look & Feel",
|
||||||
|
"icon": "preferences-desktop-theme",
|
||||||
|
"cmd": "lxappearance"
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"menu": {
|
"menu": {
|
||||||
"name": "Exit",
|
"name": "Exit",
|
||||||
"icon": "system-shutdown-symbolic",
|
"icon": "system-shutdown-symbolic",
|
||||||
"items": [
|
"items": [
|
||||||
{ "name": "Lock", "cmd": "swaylock -f -c 000000" },
|
{
|
||||||
{ "name": "Logout", "cmd": "swaymsg exit" },
|
"name": "Lock",
|
||||||
{ "name": "Reboot", "cmd": "systemctl reboot" },
|
"cmd": "swaylock -f -c 000000"
|
||||||
{ "name": "Shutdown", "cmd": "systemctl -i poweroff" }
|
},
|
||||||
]
|
{
|
||||||
},
|
"name": "Logout",
|
||||||
"show-values": false,
|
"cmd": "swaymsg exit"
|
||||||
"interval": 1,
|
},
|
||||||
"icon-size": 16,
|
{
|
||||||
"css-name": "controls-window",
|
"name": "Reboot",
|
||||||
"net-interface": "wlo1"
|
"cmd": "systemctl reboot"
|
||||||
},
|
},
|
||||||
"button-grid": {
|
{
|
||||||
"icon": "view-grid",
|
"name": "Shutdown",
|
||||||
"command": "nwggrid -p",
|
"cmd": "systemctl -i poweroff"
|
||||||
"css-name": "button-grid"
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"playerctl": {
|
"playerctl": {
|
||||||
"interval": 1,
|
"interval": 1,
|
||||||
"buttons": true,
|
|
||||||
"buttons-position": "left",
|
"buttons-position": "left",
|
||||||
"chars": 50,
|
"chars": 50,
|
||||||
"css-name": "button-grid"
|
"label-css-name": "",
|
||||||
|
"button-css-name": "",
|
||||||
|
"icon-size": 16
|
||||||
},
|
},
|
||||||
"clock": {
|
"clock": {
|
||||||
"format": "%a, %d. %b %H:%M:%S",
|
"format": "%a, %d. %b %H:%M:%S",
|
||||||
"interval": 1,
|
"interval": 1,
|
||||||
"on-right-click": "/home/piotr/PycharmProjects/swayinfo/calendar.py"
|
"on-left-click": "",
|
||||||
|
"css-name": "clock",
|
||||||
|
"tooltip-text": "",
|
||||||
|
"on-right-click": "",
|
||||||
|
"on-middle-click": "",
|
||||||
|
"on-scroll-up": "",
|
||||||
|
"on-scroll-down": ""
|
||||||
},
|
},
|
||||||
"executor-weather": {
|
"executor-weather": {
|
||||||
"script": "curl https://wttr.in/?format=1 -s",
|
"script": "curl https://wttr.in/?format=1 -s",
|
||||||
"interval": 1800,
|
"interval": 1800,
|
||||||
"css-name": "weather",
|
"css-name": "weather",
|
||||||
"on-right-click": "/home/piotr/PycharmProjects/swayinfo/calendar.py"
|
"on-right-click": "",
|
||||||
},
|
|
||||||
"executor-arch": {
|
|
||||||
"script": "/home/piotr/.config/nwg-panel/executors/arch_updates.py",
|
|
||||||
"interval": 900,
|
|
||||||
"icon-size": 16,
|
"icon-size": 16,
|
||||||
"on-left-click": "lxterminal -e \"/home/piotr/PycharmProjects/swayinfo/au.sh; swaymsg reload\""
|
"show-icon": false,
|
||||||
|
"tooltip-text": "",
|
||||||
|
"on-left-click": "",
|
||||||
|
"on-middle-click": "",
|
||||||
|
"on-scroll-up": "",
|
||||||
|
"on-scroll-down": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"output": "",
|
||||||
|
"layer": "bottom",
|
||||||
|
"position": "bottom",
|
||||||
|
"height": 30,
|
||||||
|
"homogeneous": false,
|
||||||
|
"margin-top": 0,
|
||||||
|
"margin-bottom": 0,
|
||||||
|
"padding-horizontal": 6,
|
||||||
|
"padding-vertical": 0,
|
||||||
|
"spacing": 0,
|
||||||
|
"items-padding": 0,
|
||||||
|
"css-name": "",
|
||||||
|
"icons": "light",
|
||||||
|
"controls": false,
|
||||||
|
"modules-left": [
|
||||||
|
"sway-taskbar"
|
||||||
|
],
|
||||||
|
"modules-center": [],
|
||||||
|
"modules-right": [
|
||||||
|
"executor-uptime"
|
||||||
|
],
|
||||||
|
"sway-taskbar": {
|
||||||
|
"workspace-buttons": false,
|
||||||
|
"show-app-icon": true,
|
||||||
|
"show-layout": true,
|
||||||
|
"show-app-name": true,
|
||||||
|
"name-max-len": 20,
|
||||||
|
"workspaces-spacing": 0,
|
||||||
|
"task-spacing": 0,
|
||||||
|
"all-outputs": true
|
||||||
},
|
},
|
||||||
"executor-github": {
|
"executor-uptime": {
|
||||||
"script": "/home/piotr/.config/nwg-panel/executors/github.sh",
|
"script": "uname -sr",
|
||||||
"interval": 60,
|
"interval": 60,
|
||||||
|
"css-name": "",
|
||||||
|
"on-right-click": "",
|
||||||
"icon-size": 16,
|
"icon-size": 16,
|
||||||
"on-left-click": "chromium https://github.com/notifications; swaymsg reload"
|
"show-icon": false,
|
||||||
|
"tooltip-text": "",
|
||||||
|
"on-left-click": "",
|
||||||
|
"on-middle-click": "",
|
||||||
|
"on-scroll-up": "",
|
||||||
|
"on-scroll-down": ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
@@ -2,7 +2,7 @@ button {
|
|||||||
margin: 2px;
|
margin: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#button-grid {
|
#button-custom {
|
||||||
background: rgba (255, 255, 255, 0.0);
|
background: rgba (255, 255, 255, 0.0);
|
||||||
border: 0
|
border: 0
|
||||||
}
|
}
|
||||||
|
@@ -59,7 +59,11 @@ def check_tree():
|
|||||||
|
|
||||||
def instantiate_content(panel, container, content_list):
|
def instantiate_content(panel, container, content_list):
|
||||||
check_key(panel, "items-padding", 0)
|
check_key(panel, "items-padding", 0)
|
||||||
check_key(panel, "icons", "light")
|
check_key(panel, "icons", "")
|
||||||
|
if panel["icons"] == "light":
|
||||||
|
common.icons_path = "icons_light"
|
||||||
|
elif panel["icons"] == "dark":
|
||||||
|
common.icons_path = "icons_dark"
|
||||||
|
|
||||||
for item in content_list:
|
for item in content_list:
|
||||||
if item == "sway-taskbar":
|
if item == "sway-taskbar":
|
||||||
@@ -174,10 +178,16 @@ def main():
|
|||||||
if panel["css-name"]:
|
if panel["css-name"]:
|
||||||
window.set_property("name", panel["css-name"])
|
window.set_property("name", panel["css-name"])
|
||||||
|
|
||||||
|
if "output" not in panel or not panel["output"]:
|
||||||
|
display = Gdk.Display.get_default()
|
||||||
|
monitor = display.get_monitor(0)
|
||||||
|
for key in common.outputs:
|
||||||
|
if common.outputs[key]["monitor"] == monitor:
|
||||||
|
panel["output"] = key
|
||||||
# If not full screen width demanded explicit, let's leave 6 pixel of margin on both sides on multi-headed
|
# If not full screen width demanded explicit, let's leave 6 pixel of margin on both sides on multi-headed
|
||||||
# setups. Otherwise moving the pointer between displays over the panels remains undetected,
|
# setups. Otherwise moving the pointer between displays over the panels remains undetected,
|
||||||
# and the Controls window may appear on the previous output.
|
# and the Controls window may appear on the previous output.
|
||||||
if "output" in panel and "width" not in panel:
|
if "output" in panel and panel["output"] and "width" not in panel:
|
||||||
panel["width"] = common.outputs[panel["output"]]["width"] - 12
|
panel["width"] = common.outputs[panel["output"]]["width"] - 12
|
||||||
|
|
||||||
check_key(panel, "width", 0)
|
check_key(panel, "width", 0)
|
||||||
|
@@ -85,11 +85,11 @@ class Clock(Gtk.EventBox):
|
|||||||
self.get_style_context().set_state(Gtk.StateFlags.NORMAL)
|
self.get_style_context().set_state(Gtk.StateFlags.NORMAL)
|
||||||
|
|
||||||
def on_button_press(self, widget, event):
|
def on_button_press(self, widget, event):
|
||||||
if event.button == 3 and self.settings["on-left-click"]:
|
if event.button == 1 and self.settings["on-left-click"]:
|
||||||
self.launch(self.settings["on-left-click"])
|
self.launch(self.settings["on-left-click"])
|
||||||
elif event.button == 2 and self.settings["on-middle-click"]:
|
elif event.button == 2 and self.settings["on-middle-click"]:
|
||||||
self.launch(self.settings["on-middle-click"])
|
self.launch(self.settings["on-middle-click"])
|
||||||
elif event.button == 1 and self.settings["on-right-click"]:
|
elif event.button == 3 and self.settings["on-right-click"]:
|
||||||
self.launch(self.settings["on-right-click"])
|
self.launch(self.settings["on-right-click"])
|
||||||
|
|
||||||
def on_scroll(self, widget, event):
|
def on_scroll(self, widget, event):
|
||||||
|
@@ -27,20 +27,21 @@ class Playerctl(Gtk.EventBox):
|
|||||||
self.label = Gtk.Label("")
|
self.label = Gtk.Label("")
|
||||||
self.icon_path = None
|
self.icon_path = None
|
||||||
self.play_pause_btn = Gtk.Button()
|
self.play_pause_btn = Gtk.Button()
|
||||||
|
check_key(settings, "button-css-name", "")
|
||||||
|
if self.settings["button-css-name"]:
|
||||||
|
self.play_pause_btn.set_property("name", self.settings["button-css-name"])
|
||||||
self.status = ""
|
self.status = ""
|
||||||
self.retries = 2 # to avoid hiding the module on forward / backward btn when playing from the browser
|
self.retries = 2 # to avoid hiding the module on forward / backward btn when playing from the browser
|
||||||
|
|
||||||
check_key(settings, "interval", 0)
|
check_key(settings, "interval", 0)
|
||||||
check_key(settings, "css-name", "")
|
check_key(settings, "label-css-name", "")
|
||||||
|
check_key(settings, "button-css-name", "")
|
||||||
check_key(settings, "icon-size", 16)
|
check_key(settings, "icon-size", 16)
|
||||||
check_key(settings, "buttons", True)
|
|
||||||
check_key(settings, "buttons-position", "left")
|
check_key(settings, "buttons-position", "left")
|
||||||
check_key(settings, "chars", 30)
|
check_key(settings, "chars", 30)
|
||||||
|
|
||||||
if settings["css-name"]:
|
if settings["label-css-name"]:
|
||||||
self.label.set_property("name", settings["css-name"])
|
self.label.set_property("name", settings["label-css-name"])
|
||||||
else:
|
|
||||||
self.label.set_property("name", "executor-label")
|
|
||||||
|
|
||||||
self.build_box()
|
self.build_box()
|
||||||
|
|
||||||
@@ -90,11 +91,13 @@ class Playerctl(Gtk.EventBox):
|
|||||||
|
|
||||||
def build_box(self):
|
def build_box(self):
|
||||||
button_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=0)
|
button_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=0)
|
||||||
|
|
||||||
img = Gtk.Image()
|
img = Gtk.Image()
|
||||||
update_image(img, "media-skip-backward-symbolic", self.settings["icon-size"])
|
update_image(img, "media-skip-backward-symbolic", self.settings["icon-size"])
|
||||||
btn = Gtk.Button()
|
btn = Gtk.Button()
|
||||||
btn.set_image(img)
|
btn.set_image(img)
|
||||||
|
if self.settings["button-css-name"]:
|
||||||
|
btn.set_property("name", self.settings["button-css-name"])
|
||||||
btn.connect("clicked", self.launch, "playerctl previous")
|
btn.connect("clicked", self.launch, "playerctl previous")
|
||||||
button_box.pack_start(btn, False, False, 1)
|
button_box.pack_start(btn, False, False, 1)
|
||||||
|
|
||||||
@@ -108,6 +111,8 @@ class Playerctl(Gtk.EventBox):
|
|||||||
update_image(img, "media-skip-forward-symbolic", self.settings["icon-size"])
|
update_image(img, "media-skip-forward-symbolic", self.settings["icon-size"])
|
||||||
btn = Gtk.Button()
|
btn = Gtk.Button()
|
||||||
btn.set_image(img)
|
btn.set_image(img)
|
||||||
|
if self.settings["button-css-name"]:
|
||||||
|
btn.set_property("name", self.settings["button-css-name"])
|
||||||
btn.connect("clicked", self.launch, "playerctl next")
|
btn.connect("clicked", self.launch, "playerctl next")
|
||||||
button_box.pack_start(btn, False, False, 1)
|
button_box.pack_start(btn, False, False, 1)
|
||||||
|
|
||||||
|
@@ -174,8 +174,6 @@ def list_outputs():
|
|||||||
print("'wlr-randr' command not found, terminating")
|
print("'wlr-randr' command not found, terminating")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
display = Gdk.Display.get_default()
|
display = Gdk.Display.get_default()
|
||||||
for i in range(display.get_n_monitors()):
|
for i in range(display.get_n_monitors()):
|
||||||
monitor = display.get_monitor(i)
|
monitor = display.get_monitor(i)
|
||||||
|
Reference in New Issue
Block a user