From 0e6d5656e117f4506e54e38fbe63db090e6865cb Mon Sep 17 00:00:00 2001 From: Heitor Augusto Date: Tue, 30 Jul 2024 21:36:16 +0000 Subject: [PATCH 1/7] Add plasma-panel-spacer-extended widget-specific options --- modules/widgets/default.nix | 1 + modules/widgets/panel-spacer-extended.nix | 325 ++++++++++++++++++++++ 2 files changed, 326 insertions(+) create mode 100644 modules/widgets/panel-spacer-extended.nix diff --git a/modules/widgets/default.nix b/modules/widgets/default.nix index b32b5764..05d12a13 100644 --- a/modules/widgets/default.nix +++ b/modules/widgets/default.nix @@ -10,6 +10,7 @@ let ./digital-clock.nix ./icon-tasks.nix ./kickoff.nix + ./panel-spacer-extended.nix ./plasmusic-toolbar.nix ./system-monitor.nix ./system-tray.nix diff --git a/modules/widgets/panel-spacer-extended.nix b/modules/widgets/panel-spacer-extended.nix new file mode 100644 index 00000000..02165d7c --- /dev/null +++ b/modules/widgets/panel-spacer-extended.nix @@ -0,0 +1,325 @@ +{ lib, ... }: +let + inherit (lib) mkOption types; + + actionType = types.submodule { + options = { + action = mkOption { + type = types.str; + example = "pausemedia"; + description = "The action to perform."; + }; + component = mkOption { + type = types.str; + example = "mediacontrol"; + description = "The component to perform the action on."; + }; + command = mkOption { + type = types.nullOr types.str; + example = ''date="$(date -u)"; notify-send "Single Click" "$date"''; + description = "The command to log."; + }; + appUrl = mkOption { + type = types.nullOr types.str; + description = "The application URL"; + }; + }; + }; +in { + panelSpacerExtended = { + description = "Spacer with Mouse gestures for the KDE Plasma Panel featuring Latte Dock/Gnome/Unity drag window gesture."; + + opts = { + expanding = mkOption { + type = types.nullOr types.bool; + default = null; + example = true; + description = "Whether the spacer should expand to fill the available space."; + }; + length = mkOption { + type = types.nullOr types.ints.unsigned; + default = null; + example = 32; + description = '' + The length in pixels of the spacer. + Configuration effective only if expanding is set to false. + ''; + }; + highlight = { + enable = mkOption { + type = types.nullOr types.bool; + default = null; + example = true; + description = "Whether the spacer should highlight when hovered."; + }; + radius = mkOption { + type = types.nullOr types.ints.unsigned; + default = null; + example = 4; + description = '' + The radius in pixels of the highlight. + Configuration effective only if enable is set to true. + ''; + }; + fillPanel = mkOption { + type = types.nullOr types.bool; + default = null; + example = true; + description = '' + Whether the highlight should fill the entire panel. + Configuration effective only if enable is set to true. + ''; + }; + }; + showTooltip = mkOption { + type = types.nullOr types.bool; + default = null; + example = true; + description = "Whether to show list of actions when hovering the spacer."; + }; + scrollThreshold = mkOption { + type = types.nullOr types.ints.unsigned; + default = null; + example = 10; + description = '' + The scroll sensitivity + + Higher values may help reducing repeated scrolling events on some devices. + ''; + }; + actions = { + singleClick = mkOption { + type = types.nullOr actionType; + default = null; + example = { + action = "pausemedia"; + component = "mediacontrol"; + command = ''date="$(date -u)"; notify-send "Single Click" "$date"''; + }; + description = "The action to perform on single click."; + apply = singleClick: let + convertAction = action: component: "${component},${action}"; + in lib.optionalAttrs (singleClick != null) { + singleClickAction = convertAction singleClick.action singleClick.component; + singleClickCommand = singleClick.command; + singleClickAppUrl = singleClick.appUrl; + }; + }; + doubleClick = mkOption { + type = types.nullOr actionType; + default = null; + example = { + action = "pausemedia"; + component = "mediacontrol"; + command = ''date="$(date -u)"; notify-send "Double Click" "$date"''; + }; + description = "The action to perform on double click."; + apply = doubleClick: let + convertAction = action: component: "${component},${action}"; + in lib.optionalAttrs (doubleClick != null) { + doubleClickAction = convertAction doubleClick.action doubleClick.component; + doubleClickCommand = doubleClick.command; + doubleClickAppUrl = doubleClick.appUrl; + }; + }; + middleClick = mkOption { + type = types.nullOr actionType; + default = null; + example = { + action = "pausemedia"; + component = "mediacontrol"; + command = ''date="$(date -u)"; notify-send "Middle Click" "$date"''; + }; + description = "The action to perform on middle click."; + apply = middleClick: let + convertAction = action: component: "${component},${action}"; + in lib.optionalAttrs (middleClick != null) { + middleClickAction = convertAction middleClick.action middleClick.component; + middleClickCommand = middleClick.command; + middleClickAppUrl = middleClick.appUrl; + }; + }; + mouseWheelUp = mkOption { + type = types.nullOr actionType; + default = null; + example = { + action = "pausemedia"; + component = "mediacontrol"; + command = ''date="$(date -u)"; notify-send "Wheel Up" "$date"''; + }; + description = "The action to perform on mouse wheel up."; + apply = mouseWheelUp: let + convertAction = action: component: "${component},${action}"; + in lib.optionalAttrs (mouseWheelUp != null) { + mouseWheelUpAction = convertAction mouseWheelUp.action mouseWheelUp.component; + mouseWheelUpCommand = mouseWheelUp.command; + mouseWheelUpAppUrl = mouseWheelUp.appUrl; + }; + }; + mouseWheelDown = mkOption { + type = types.nullOr actionType; + default = null; + example = { + action = "pausemedia"; + component = "mediacontrol"; + command = ''date="$(date -u)"; notify-send "Wheel Down" "$date"''; + }; + description = "The action to perform on mouse wheel down."; + apply = mouseWheelDown: let + convertAction = action: component: "${component},${action}"; + in lib.optionalAttrs (mouseWheelDown != null) { + mouseWheelDownAction = convertAction mouseWheelDown.action mouseWheelDown.component; + mouseWheelDownCommand = mouseWheelDown.command; + mouseWheelDownAppUrl = mouseWheelDown.appUrl; + }; + }; + mouseDragUp = mkOption { + type = types.nullOr actionType; + default = null; + example = { + action = "pausemedia"; + component = "mediacontrol"; + command = ''date="$(date -u)"; notify-send "Drag Up" "$date"''; + }; + description = "The action to perform on mouse drag up."; + apply = mouseDragUp: let + convertAction = action: component: "${component},${action}"; + in lib.optionalAttrs (mouseDragUp != null) { + mouseDragUpAction = convertAction mouseDragUp.action mouseDragUp.component; + mouseDragUpCommand = mouseDragUp.command; + mouseDragUpAppUrl = mouseDragUp.appUrl; + }; + }; + mouseDragDown = mkOption { + type = types.nullOr actionType; + default = null; + example = { + action = "pausemedia"; + component = "mediacontrol"; + command = ''date="$(date -u)"; notify-send "Drag Down" "$date"''; + }; + description = "The action to perform on mouse drag down."; + apply = mouseDragDown: let + convertAction = action: component: "${component},${action}"; + in lib.optionalAttrs (mouseDragDown != null) { + mouseDragDownAction = convertAction mouseDragDown.action mouseDragDown.component; + mouseDragDownCommand = mouseDragDown.command; + mouseDragDownAppUrl = mouseDragDown.appUrl; + }; + }; + mouseDragLeft = mkOption { + type = types.nullOr actionType; + default = null; + example = { + action = "pausemedia"; + component = "mediacontrol"; + command = ''date="$(date -u)"; notify-send "Drag Left" "$date"''; + }; + description = "The action to perform on mouse drag left."; + apply = mouseDragLeft: let + convertAction = action: component: "${component},${action}"; + in lib.optionalAttrs (mouseDragLeft != null) { + mouseDragLeftAction = convertAction mouseDragLeft.action mouseDragLeft.component; + mouseDragLeftCommand = mouseDragLeft.command; + mouseDragLeftAppUrl = mouseDragLeft.appUrl; + }; + }; + mouseDragRight = mkOption { + type = types.nullOr actionType; + default = null; + example = { + action = "pausemedia"; + component = "mediacontrol"; + command = ''date="$(date -u)"; notify-send "Drag Right" "$date"''; + }; + description = "The action to perform on mouse drag right."; + apply = mouseDragRight: let + convertAction = action: component: "${component},${action}"; + in lib.optionalAttrs (mouseDragRight != null) { + mouseDragRightAction = convertAction mouseDragRight.action mouseDragRight.component; + mouseDragRightCommand = mouseDragRight.command; + mouseDragRightAppUrl = mouseDragRight.appUrl; + }; + }; + longPress = mkOption { + type = types.nullOr actionType; + default = null; + example = { + action = "pausemedia"; + component = "mediacontrol"; + command = ''date="$(date -u)"; notify-send "Long Press" "$date"''; + }; + description = "The action to perform on long press."; + apply = longPress: let + convertAction = action: component: "${component},${action}"; + in lib.optionalAttrs (longPress != null) { + pressHoldAction = convertAction longPress.action longPress.component; + pressHoldCommand = longPress.command; + pressHoldAppUrl = longPress.appUrl; + }; + }; + }; + troubleshooting = { + debugMessages.enable = mkOption { + type = types.nullOr types.bool; + default = null; + example = true; + description = "Whether to enable debug messages."; + }; + }; + settings = mkOption { + type = with types; nullOr (attrsOf (attrsOf (either (oneOf [ bool float int str ]) (listOf (oneOf [ bool float int str ]))))); + default = null; + example = { + General = { + expanding = true; + }; + }; + description = '' + Extra configuration for the widget + + See available options at https://github.com/antroids/application-title-bar/blob/main/package/contents/config/main.xml + ''; + apply = settings: if settings == null then {} else settings; + }; + }; + + convert = + { expanding + , length + , highlight + , showTooltip + , scrollThreshold + , actions + , troubleshooting + , settings + }: { + name = "luisbocanegra.panelspacer.extended"; + config = lib.recursiveUpdate { + General = lib.filterAttrs (_: v: v != null) ( + { + inherit expanding length showTooltip; + + showHoverBg = highlight.enable; + hoverBgRadius = highlight.radius; + bgFillPanel = highlight.fillPanel; + + scrollSensitivity = scrollThreshold; + + enableDebug = troubleshooting.debugMessages.enable; + } + // actions.singleClick + // actions.doubleClick + // actions.middleClick + // actions.mouseWheelUp + // actions.mouseWheelDown + // actions.mouseDragUp + // actions.mouseDragDown + // actions.mouseDragLeft + // actions.mouseDragRight + // actions.longPress + ); + } settings; + }; + }; +} \ No newline at end of file From e08c14397fc1489bfa1d4e1478d50bbfbadfbb9a Mon Sep 17 00:00:00 2001 From: Heitor Augusto Date: Wed, 31 Jul 2024 14:57:35 +0000 Subject: [PATCH 2/7] Add screenWidth option and filter null attribute values in actions --- modules/widgets/panel-spacer-extended.nix | 49 +++++++++++++---------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/modules/widgets/panel-spacer-extended.nix b/modules/widgets/panel-spacer-extended.nix index 02165d7c..cb13f621 100644 --- a/modules/widgets/panel-spacer-extended.nix +++ b/modules/widgets/panel-spacer-extended.nix @@ -77,6 +77,12 @@ in { example = true; description = "Whether to show list of actions when hovering the spacer."; }; + screenWidth = mkOption { + type = types.nullOr types.ints.positive; + default = null; + example = 1920; + description = "The screen width in pixels."; + }; scrollThreshold = mkOption { type = types.nullOr types.ints.unsigned; default = null; @@ -99,11 +105,11 @@ in { description = "The action to perform on single click."; apply = singleClick: let convertAction = action: component: "${component},${action}"; - in lib.optionalAttrs (singleClick != null) { + in lib.optionalAttrs (singleClick != null) lib.filterAttrs (_: v: v != null) ({ singleClickAction = convertAction singleClick.action singleClick.component; singleClickCommand = singleClick.command; singleClickAppUrl = singleClick.appUrl; - }; + }); }; doubleClick = mkOption { type = types.nullOr actionType; @@ -116,11 +122,11 @@ in { description = "The action to perform on double click."; apply = doubleClick: let convertAction = action: component: "${component},${action}"; - in lib.optionalAttrs (doubleClick != null) { + in lib.optionalAttrs (doubleClick != null) lib.filterAttrs (_: v: v != null) ({ doubleClickAction = convertAction doubleClick.action doubleClick.component; doubleClickCommand = doubleClick.command; doubleClickAppUrl = doubleClick.appUrl; - }; + }); }; middleClick = mkOption { type = types.nullOr actionType; @@ -133,11 +139,11 @@ in { description = "The action to perform on middle click."; apply = middleClick: let convertAction = action: component: "${component},${action}"; - in lib.optionalAttrs (middleClick != null) { + in lib.optionalAttrs (middleClick != null) lib.filterAttrs (_: v: v != null) ({ middleClickAction = convertAction middleClick.action middleClick.component; middleClickCommand = middleClick.command; middleClickAppUrl = middleClick.appUrl; - }; + }); }; mouseWheelUp = mkOption { type = types.nullOr actionType; @@ -150,11 +156,11 @@ in { description = "The action to perform on mouse wheel up."; apply = mouseWheelUp: let convertAction = action: component: "${component},${action}"; - in lib.optionalAttrs (mouseWheelUp != null) { + in lib.optionalAttrs (mouseWheelUp != null) lib.filterAttrs (_: v: v != null) ({ mouseWheelUpAction = convertAction mouseWheelUp.action mouseWheelUp.component; mouseWheelUpCommand = mouseWheelUp.command; mouseWheelUpAppUrl = mouseWheelUp.appUrl; - }; + }); }; mouseWheelDown = mkOption { type = types.nullOr actionType; @@ -167,11 +173,11 @@ in { description = "The action to perform on mouse wheel down."; apply = mouseWheelDown: let convertAction = action: component: "${component},${action}"; - in lib.optionalAttrs (mouseWheelDown != null) { + in lib.optionalAttrs (mouseWheelDown != null) lib.filterAttrs (_: v: v != null) ({ mouseWheelDownAction = convertAction mouseWheelDown.action mouseWheelDown.component; mouseWheelDownCommand = mouseWheelDown.command; mouseWheelDownAppUrl = mouseWheelDown.appUrl; - }; + }); }; mouseDragUp = mkOption { type = types.nullOr actionType; @@ -184,11 +190,11 @@ in { description = "The action to perform on mouse drag up."; apply = mouseDragUp: let convertAction = action: component: "${component},${action}"; - in lib.optionalAttrs (mouseDragUp != null) { + in lib.optionalAttrs (mouseDragUp != null) lib.filterAttrs (_: v: v != null) ({ mouseDragUpAction = convertAction mouseDragUp.action mouseDragUp.component; mouseDragUpCommand = mouseDragUp.command; mouseDragUpAppUrl = mouseDragUp.appUrl; - }; + }); }; mouseDragDown = mkOption { type = types.nullOr actionType; @@ -201,11 +207,11 @@ in { description = "The action to perform on mouse drag down."; apply = mouseDragDown: let convertAction = action: component: "${component},${action}"; - in lib.optionalAttrs (mouseDragDown != null) { + in lib.optionalAttrs (mouseDragDown != null) lib.filterAttrs (_: v: v != null) ({ mouseDragDownAction = convertAction mouseDragDown.action mouseDragDown.component; mouseDragDownCommand = mouseDragDown.command; mouseDragDownAppUrl = mouseDragDown.appUrl; - }; + }); }; mouseDragLeft = mkOption { type = types.nullOr actionType; @@ -218,11 +224,11 @@ in { description = "The action to perform on mouse drag left."; apply = mouseDragLeft: let convertAction = action: component: "${component},${action}"; - in lib.optionalAttrs (mouseDragLeft != null) { + in lib.optionalAttrs (mouseDragLeft != null) lib.filterAttrs (_: v: v != null) ({ mouseDragLeftAction = convertAction mouseDragLeft.action mouseDragLeft.component; mouseDragLeftCommand = mouseDragLeft.command; mouseDragLeftAppUrl = mouseDragLeft.appUrl; - }; + }); }; mouseDragRight = mkOption { type = types.nullOr actionType; @@ -235,11 +241,11 @@ in { description = "The action to perform on mouse drag right."; apply = mouseDragRight: let convertAction = action: component: "${component},${action}"; - in lib.optionalAttrs (mouseDragRight != null) { + in lib.optionalAttrs (mouseDragRight != null) lib.filterAttrs (_: v: v != null) ({ mouseDragRightAction = convertAction mouseDragRight.action mouseDragRight.component; mouseDragRightCommand = mouseDragRight.command; mouseDragRightAppUrl = mouseDragRight.appUrl; - }; + }); }; longPress = mkOption { type = types.nullOr actionType; @@ -252,11 +258,11 @@ in { description = "The action to perform on long press."; apply = longPress: let convertAction = action: component: "${component},${action}"; - in lib.optionalAttrs (longPress != null) { + in lib.optionalAttrs (longPress != null) lib.filterAttrs (_: v: v != null) ({ pressHoldAction = convertAction longPress.action longPress.component; pressHoldCommand = longPress.command; pressHoldAppUrl = longPress.appUrl; - }; + }); }; }; troubleshooting = { @@ -289,6 +295,7 @@ in { , length , highlight , showTooltip + , screenWidth , scrollThreshold , actions , troubleshooting @@ -298,7 +305,7 @@ in { config = lib.recursiveUpdate { General = lib.filterAttrs (_: v: v != null) ( { - inherit expanding length showTooltip; + inherit expanding length showTooltip screenWidth; showHoverBg = highlight.enable; hoverBgRadius = highlight.radius; From 22a4f463f86901f630a6c3bf231555757c612fed Mon Sep 17 00:00:00 2001 From: Heitor Augusto Date: Wed, 31 Jul 2024 15:03:38 +0000 Subject: [PATCH 3/7] Remove command in examples --- modules/widgets/panel-spacer-extended.nix | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/modules/widgets/panel-spacer-extended.nix b/modules/widgets/panel-spacer-extended.nix index cb13f621..3f9bd1ac 100644 --- a/modules/widgets/panel-spacer-extended.nix +++ b/modules/widgets/panel-spacer-extended.nix @@ -100,7 +100,6 @@ in { example = { action = "pausemedia"; component = "mediacontrol"; - command = ''date="$(date -u)"; notify-send "Single Click" "$date"''; }; description = "The action to perform on single click."; apply = singleClick: let @@ -117,7 +116,6 @@ in { example = { action = "pausemedia"; component = "mediacontrol"; - command = ''date="$(date -u)"; notify-send "Double Click" "$date"''; }; description = "The action to perform on double click."; apply = doubleClick: let @@ -134,7 +132,6 @@ in { example = { action = "pausemedia"; component = "mediacontrol"; - command = ''date="$(date -u)"; notify-send "Middle Click" "$date"''; }; description = "The action to perform on middle click."; apply = middleClick: let @@ -151,7 +148,6 @@ in { example = { action = "pausemedia"; component = "mediacontrol"; - command = ''date="$(date -u)"; notify-send "Wheel Up" "$date"''; }; description = "The action to perform on mouse wheel up."; apply = mouseWheelUp: let @@ -168,7 +164,6 @@ in { example = { action = "pausemedia"; component = "mediacontrol"; - command = ''date="$(date -u)"; notify-send "Wheel Down" "$date"''; }; description = "The action to perform on mouse wheel down."; apply = mouseWheelDown: let @@ -185,7 +180,6 @@ in { example = { action = "pausemedia"; component = "mediacontrol"; - command = ''date="$(date -u)"; notify-send "Drag Up" "$date"''; }; description = "The action to perform on mouse drag up."; apply = mouseDragUp: let @@ -202,7 +196,6 @@ in { example = { action = "pausemedia"; component = "mediacontrol"; - command = ''date="$(date -u)"; notify-send "Drag Down" "$date"''; }; description = "The action to perform on mouse drag down."; apply = mouseDragDown: let @@ -219,7 +212,6 @@ in { example = { action = "pausemedia"; component = "mediacontrol"; - command = ''date="$(date -u)"; notify-send "Drag Left" "$date"''; }; description = "The action to perform on mouse drag left."; apply = mouseDragLeft: let @@ -236,7 +228,6 @@ in { example = { action = "pausemedia"; component = "mediacontrol"; - command = ''date="$(date -u)"; notify-send "Drag Right" "$date"''; }; description = "The action to perform on mouse drag right."; apply = mouseDragRight: let @@ -253,7 +244,6 @@ in { example = { action = "pausemedia"; component = "mediacontrol"; - command = ''date="$(date -u)"; notify-send "Long Press" "$date"''; }; description = "The action to perform on long press."; apply = longPress: let From 53df739dc31cdeae2fd56b7697b626bf7275a0a9 Mon Sep 17 00:00:00 2001 From: Heitor Augusto Date: Wed, 31 Jul 2024 15:07:52 +0000 Subject: [PATCH 4/7] Add panel-spacer-extended example in home.nix --- examples/home.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/examples/home.nix b/examples/home.nix index dca139af..9c5ab4a9 100644 --- a/examples/home.nix +++ b/examples/home.nix @@ -165,6 +165,20 @@ } "org.kde.plasma.appmenu" "org.kde.plasma.panelspacer" + { + panelSpacerExtended = { + actions = { + singleClick = { + action = "playpausemedia"; + component = "mediacontrol"; + }; + doubleClick = { + action = "Overview"; + component = "kwin"; + }; + }; + }; + } { plasmusicToolbar = { panelIcon = { From 0ee6c6f35bdb930b90c827b43c923e91991cd15f Mon Sep 17 00:00:00 2001 From: Heitor Augusto Date: Wed, 31 Jul 2024 15:17:30 +0000 Subject: [PATCH 5/7] Make command and appUrl optional --- modules/widgets/panel-spacer-extended.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/widgets/panel-spacer-extended.nix b/modules/widgets/panel-spacer-extended.nix index 3f9bd1ac..23f38378 100644 --- a/modules/widgets/panel-spacer-extended.nix +++ b/modules/widgets/panel-spacer-extended.nix @@ -16,11 +16,13 @@ let }; command = mkOption { type = types.nullOr types.str; + default = null; example = ''date="$(date -u)"; notify-send "Single Click" "$date"''; description = "The command to log."; }; appUrl = mkOption { type = types.nullOr types.str; + default = null; description = "The application URL"; }; }; From b0fde110d9e35b316c4f087da3110c750d78fd04 Mon Sep 17 00:00:00 2001 From: Heitor Augusto Date: Wed, 31 Jul 2024 15:25:57 +0000 Subject: [PATCH 6/7] Remove lib.filterAttrs from actions --- modules/widgets/panel-spacer-extended.nix | 38 +++++++++++------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/modules/widgets/panel-spacer-extended.nix b/modules/widgets/panel-spacer-extended.nix index 23f38378..bd973160 100644 --- a/modules/widgets/panel-spacer-extended.nix +++ b/modules/widgets/panel-spacer-extended.nix @@ -106,11 +106,11 @@ in { description = "The action to perform on single click."; apply = singleClick: let convertAction = action: component: "${component},${action}"; - in lib.optionalAttrs (singleClick != null) lib.filterAttrs (_: v: v != null) ({ + in lib.optionalAttrs (singleClick != null) { singleClickAction = convertAction singleClick.action singleClick.component; singleClickCommand = singleClick.command; singleClickAppUrl = singleClick.appUrl; - }); + }; }; doubleClick = mkOption { type = types.nullOr actionType; @@ -122,11 +122,11 @@ in { description = "The action to perform on double click."; apply = doubleClick: let convertAction = action: component: "${component},${action}"; - in lib.optionalAttrs (doubleClick != null) lib.filterAttrs (_: v: v != null) ({ + in lib.optionalAttrs (doubleClick != null) { doubleClickAction = convertAction doubleClick.action doubleClick.component; doubleClickCommand = doubleClick.command; doubleClickAppUrl = doubleClick.appUrl; - }); + }; }; middleClick = mkOption { type = types.nullOr actionType; @@ -138,11 +138,11 @@ in { description = "The action to perform on middle click."; apply = middleClick: let convertAction = action: component: "${component},${action}"; - in lib.optionalAttrs (middleClick != null) lib.filterAttrs (_: v: v != null) ({ + in lib.optionalAttrs (middleClick != null) { middleClickAction = convertAction middleClick.action middleClick.component; middleClickCommand = middleClick.command; middleClickAppUrl = middleClick.appUrl; - }); + }; }; mouseWheelUp = mkOption { type = types.nullOr actionType; @@ -154,11 +154,11 @@ in { description = "The action to perform on mouse wheel up."; apply = mouseWheelUp: let convertAction = action: component: "${component},${action}"; - in lib.optionalAttrs (mouseWheelUp != null) lib.filterAttrs (_: v: v != null) ({ + in lib.optionalAttrs (mouseWheelUp != null) { mouseWheelUpAction = convertAction mouseWheelUp.action mouseWheelUp.component; mouseWheelUpCommand = mouseWheelUp.command; mouseWheelUpAppUrl = mouseWheelUp.appUrl; - }); + }; }; mouseWheelDown = mkOption { type = types.nullOr actionType; @@ -170,7 +170,7 @@ in { description = "The action to perform on mouse wheel down."; apply = mouseWheelDown: let convertAction = action: component: "${component},${action}"; - in lib.optionalAttrs (mouseWheelDown != null) lib.filterAttrs (_: v: v != null) ({ + in lib.optionalAttrs (mouseWheelDown != null) { mouseWheelDownAction = convertAction mouseWheelDown.action mouseWheelDown.component; mouseWheelDownCommand = mouseWheelDown.command; mouseWheelDownAppUrl = mouseWheelDown.appUrl; @@ -186,11 +186,11 @@ in { description = "The action to perform on mouse drag up."; apply = mouseDragUp: let convertAction = action: component: "${component},${action}"; - in lib.optionalAttrs (mouseDragUp != null) lib.filterAttrs (_: v: v != null) ({ + in lib.optionalAttrs (mouseDragUp != null) { mouseDragUpAction = convertAction mouseDragUp.action mouseDragUp.component; mouseDragUpCommand = mouseDragUp.command; mouseDragUpAppUrl = mouseDragUp.appUrl; - }); + }; }; mouseDragDown = mkOption { type = types.nullOr actionType; @@ -202,11 +202,11 @@ in { description = "The action to perform on mouse drag down."; apply = mouseDragDown: let convertAction = action: component: "${component},${action}"; - in lib.optionalAttrs (mouseDragDown != null) lib.filterAttrs (_: v: v != null) ({ + in lib.optionalAttrs (mouseDragDown != null) { mouseDragDownAction = convertAction mouseDragDown.action mouseDragDown.component; mouseDragDownCommand = mouseDragDown.command; mouseDragDownAppUrl = mouseDragDown.appUrl; - }); + }; }; mouseDragLeft = mkOption { type = types.nullOr actionType; @@ -218,11 +218,11 @@ in { description = "The action to perform on mouse drag left."; apply = mouseDragLeft: let convertAction = action: component: "${component},${action}"; - in lib.optionalAttrs (mouseDragLeft != null) lib.filterAttrs (_: v: v != null) ({ + in lib.optionalAttrs (mouseDragLeft != null) { mouseDragLeftAction = convertAction mouseDragLeft.action mouseDragLeft.component; mouseDragLeftCommand = mouseDragLeft.command; mouseDragLeftAppUrl = mouseDragLeft.appUrl; - }); + }; }; mouseDragRight = mkOption { type = types.nullOr actionType; @@ -234,11 +234,11 @@ in { description = "The action to perform on mouse drag right."; apply = mouseDragRight: let convertAction = action: component: "${component},${action}"; - in lib.optionalAttrs (mouseDragRight != null) lib.filterAttrs (_: v: v != null) ({ + in lib.optionalAttrs (mouseDragRight != null) { mouseDragRightAction = convertAction mouseDragRight.action mouseDragRight.component; mouseDragRightCommand = mouseDragRight.command; mouseDragRightAppUrl = mouseDragRight.appUrl; - }); + }; }; longPress = mkOption { type = types.nullOr actionType; @@ -250,11 +250,11 @@ in { description = "The action to perform on long press."; apply = longPress: let convertAction = action: component: "${component},${action}"; - in lib.optionalAttrs (longPress != null) lib.filterAttrs (_: v: v != null) ({ + in lib.optionalAttrs (longPress != null) { pressHoldAction = convertAction longPress.action longPress.component; pressHoldCommand = longPress.command; pressHoldAppUrl = longPress.appUrl; - }); + }; }; }; troubleshooting = { From 7aaf1b88e4837d3f1131a78de63f1175520f9c0b Mon Sep 17 00:00:00 2001 From: Heitor Augusto Date: Wed, 31 Jul 2024 15:31:58 +0000 Subject: [PATCH 7/7] Remove parenthesis --- modules/widgets/panel-spacer-extended.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/widgets/panel-spacer-extended.nix b/modules/widgets/panel-spacer-extended.nix index bd973160..43ec570e 100644 --- a/modules/widgets/panel-spacer-extended.nix +++ b/modules/widgets/panel-spacer-extended.nix @@ -174,7 +174,7 @@ in { mouseWheelDownAction = convertAction mouseWheelDown.action mouseWheelDown.component; mouseWheelDownCommand = mouseWheelDown.command; mouseWheelDownAppUrl = mouseWheelDown.appUrl; - }); + }; }; mouseDragUp = mkOption { type = types.nullOr actionType;