From 055906fbebafb9c48f8a83540a973d3a51341738 Mon Sep 17 00:00:00 2001 From: PMunch Date: Tue, 20 Feb 2024 14:42:18 +0100 Subject: [PATCH 1/2] Fix background color not resetting --- src/nimdowpkg/statusbar.nim | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nimdowpkg/statusbar.nim b/src/nimdowpkg/statusbar.nim index acf33da..0f37e40 100644 --- a/src/nimdowpkg/statusbar.nim +++ b/src/nimdowpkg/statusbar.nim @@ -513,6 +513,7 @@ proc renderStringRightAligned( while i < sgr.len: if sgr[i] == resetCode: color = -1 + bgColor = -1 selectedFont = -1 fontErrorLogged = false elif sgr[i] >= fontStart and sgr[i] <= fontStop: From 4a02890273d5b95a86d89249af3238ba60eaee65 Mon Sep 17 00:00:00 2001 From: PMunch Date: Wed, 21 Feb 2024 09:41:10 +0100 Subject: [PATCH 2/2] Add button identifier to script calling --- config.default.toml | 2 +- src/nimdowpkg/config/configloader.nim | 7 ++++--- src/nimdowpkg/windowmanager.nim | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/config.default.toml b/config.default.toml index f1677f1..1ac2e52 100644 --- a/config.default.toml +++ b/config.default.toml @@ -31,7 +31,7 @@ modifiers = [ "super" ] # Example: Start process when region is clicked, see github wiki for what constitutes a region # [[startProcess]] -# command = "notify-send \"Id: %1, rx: %2, cx: %4, w: %6\"" +# command = "notify-send \"Id: %1, rx: %2, cx: %4, cy: %5, w: %6, b: %7\"" # clickRegion = 0 [autostart] diff --git a/src/nimdowpkg/config/configloader.nim b/src/nimdowpkg/config/configloader.nim index 6da34cd..0c66d00 100644 --- a/src/nimdowpkg/config/configloader.nim +++ b/src/nimdowpkg/config/configloader.nim @@ -30,7 +30,7 @@ proc findConfigPath*(): string = type KeyCombo* = tuple[keycode: int, modifiers: int] Action* = proc(keyCombo: KeyCombo): void - RegionClickAction* = proc(idx: int, width: int, regionCord: Point[int], clickCord: Point[int]): void + RegionClickAction* = proc(idx: int, width: int, regionCord: Point[int], clickCord: Point[int], button: int): void WindowSettings* = object tagCount*: uint @@ -308,7 +308,7 @@ proc populateExternalProcessSettings(this: Config, configTable: TomlTable, displ closureScope: let command = command this.regionClickActionTable[clickRegion] = - proc(idx: int, width: int, regionCord: Point[int], clickCord: Point[int]) = + proc(idx: int, width: int, regionCord: Point[int], clickCord: Point[int], button: int) = this.runCommandWithArgs( command, $idx, @@ -316,7 +316,8 @@ proc populateExternalProcessSettings(this: Config, configTable: TomlTable, displ $regionCord.y, $clickCord.x, $clickCord.y, - $width + $width, + $button ) else: this.configureExternalProcess(command) diff --git a/src/nimdowpkg/windowmanager.nim b/src/nimdowpkg/windowmanager.nim index cd7b9c0..e8128d0 100644 --- a/src/nimdowpkg/windowmanager.nim +++ b/src/nimdowpkg/windowmanager.nim @@ -1823,7 +1823,8 @@ proc handleButtonPressed(this: WindowManager, e: XButtonEvent) = clickedInfo.index, clickedInfo.width, clickedInfo.regionCord, - clickedInfo.clickCord + clickedInfo.clickCord, + e.button.int ) return