From a9ad71ff42656dccc4a69081904cddbdd5806d92 Mon Sep 17 00:00:00 2001 From: davfsa Date: Sat, 11 Jan 2025 09:07:03 +0100 Subject: [PATCH 1/5] Update bluetooth label when a new device connects/disconnects (#708) --- src/components/bar/modules/bluetooth/index.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/bar/modules/bluetooth/index.tsx b/src/components/bar/modules/bluetooth/index.tsx index 7f55d80..a0b13ec 100644 --- a/src/components/bar/modules/bluetooth/index.tsx +++ b/src/components/bar/modules/bluetooth/index.tsx @@ -38,7 +38,13 @@ const Bluetooth = (): BarBoxChild => { ); const componentBinding = Variable.derive( - [bind(options.bar.bluetooth.label), bind(bluetoothService, 'isPowered'), bind(bluetoothService, 'devices')], + [ + bind(options.bar.bluetooth.label), + bind(bluetoothService, 'isPowered'), + bind(bluetoothService, 'devices'), + + bind(bluetoothService, 'isConnected'), + ], (showLabel: boolean, isPowered: boolean, devices: AstalBluetooth.Device[]): JSX.Element => { if (showLabel) { return ( From db3fa88d18452d87370103af82aec424515c1d3e Mon Sep 17 00:00:00 2001 From: Jas Singh Date: Sat, 11 Jan 2025 03:00:31 -0800 Subject: [PATCH 2/5] Update flake bin. (#712) --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 9bdd585..44a1e00 100644 --- a/flake.nix +++ b/flake.nix @@ -81,7 +81,7 @@ if [ "$#" -eq 0 ]; then exec ${self.packages.${final.stdenv.system}.default}/bin/hyprpanel else - exec ${ags.packages.${final.stdenv.system}.io}/bin/astal -i hyprpanel "$@" + exec ${ags.packages.${final.stdenv.system}.io}/bin/astal -i hyprpanel "$*" fi ''; }; From fab3a8c3a167c03f8b5c2bf8d5f7cd78dd287076 Mon Sep 17 00:00:00 2001 From: Jas Singh Date: Sat, 11 Jan 2025 12:40:02 -0800 Subject: [PATCH 3/5] Remove the unintended empty space from the power module in the bar. (#714) --- src/components/bar/modules/power/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/bar/modules/power/index.tsx b/src/components/bar/modules/power/index.tsx index 2ac59d7..9e2078c 100644 --- a/src/components/bar/modules/power/index.tsx +++ b/src/components/bar/modules/power/index.tsx @@ -2,7 +2,7 @@ import options from 'src/options'; import { Module } from '../../shared/Module'; import { inputHandler } from 'src/components/bar/utils/helpers'; import { BarBoxChild } from 'src/lib/types/bar'; -import { bind } from 'astal'; +import { bind, Variable } from 'astal'; import { Astal } from 'astal/gtk3'; const { icon, leftClick, rightClick, middleClick, scrollUp, scrollDown } = options.bar.customModules.power; @@ -11,6 +11,7 @@ export const Power = (): BarBoxChild => { const powerModule = Module({ tooltipText: 'Power Menu', textIcon: bind(icon), + showLabelBinding: Variable(false), boxClass: 'powermodule', props: { setup: (self: Astal.Button) => { From 636f031b7720fd33dad1ce089d447f00a41cdfdc Mon Sep 17 00:00:00 2001 From: davfsa Date: Mon, 13 Jan 2025 08:53:32 +0100 Subject: [PATCH 4/5] Code cleanup (#719) - Remove random call to `print` - Remove double declaration of notifdService --- src/components/bar/modules/notifications/index.tsx | 7 +++---- src/lib/utils.ts | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/bar/modules/notifications/index.tsx b/src/components/bar/modules/notifications/index.tsx index aa91f55..bf8d278 100644 --- a/src/components/bar/modules/notifications/index.tsx +++ b/src/components/bar/modules/notifications/index.tsx @@ -7,12 +7,11 @@ import { BarBoxChild } from 'src/lib/types/bar.js'; import { runAsyncCommand, throttledScrollHandler } from 'src/components/bar/utils/helpers.js'; import { bind, Variable } from 'astal'; import { onMiddleClick, onPrimaryClick, onScroll, onSecondaryClick } from 'src/lib/shared/eventHandlers'; +import { notifdService } from 'src/lib/constants/services'; const { show_total, rightClick, middleClick, scrollUp, scrollDown, hideCountWhenZero } = options.bar.notifications; const { ignore } = options.notifications; -const notifs = AstalNotifd.get_default(); - export const Notifications = (): BarBoxChild => { const componentClassName = Variable.derive( [bind(options.theme.bar.buttons.style), bind(show_total)], @@ -29,8 +28,8 @@ export const Notifications = (): BarBoxChild => { const boxChildren = Variable.derive( [ - bind(notifs, 'notifications'), - bind(notifs, 'dontDisturb'), + bind(notifdService, 'notifications'), + bind(notifdService, 'dontDisturb'), bind(show_total), bind(ignore), bind(hideCountWhenZero), diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 898d918..902d2b2 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -99,7 +99,7 @@ export function icon(name: string | null, fallback = icons.missing): string { if (lookUpIcon(icon)) return icon; - print(`no icon substitute "${icon}" for "${name}", fallback: "${fallback}"`); + console.log(`no icon substitute "${icon}" for "${name}", fallback: "${fallback}"`); return fallback; } From 7ef79f7362fcad55c4b0c02ef1c2dee6e2cbee18 Mon Sep 17 00:00:00 2001 From: Ferran Aran Domingo <72612615+FerranAD@users.noreply.github.com> Date: Mon, 13 Jan 2025 09:23:40 +0100 Subject: [PATCH 5/5] chore(nix): add cava options to `module.nix` (#718) --- nix/module.nix | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/nix/module.nix b/nix/module.nix index c539259..2e2b94e 100644 --- a/nix/module.nix +++ b/nix/module.nix @@ -24,6 +24,8 @@ let mkStrOption = default: mkOption { type = types.str; default = default; }; mkIntOption = default: mkOption { type = types.int; default = default; }; mkBoolOption = default: mkOption { type = types.bool; default = default; }; + mkStrListOption = default: mkOption { type = types.listOf types.str; default = default; }; + mkFloatOption = default: mkOption { type = types.float; default = default; }; # TODO: Please merge https://github.com/Jas-SinghFSU/HyprPanel/pull/497 # Do not ask what these do... @@ -149,6 +151,25 @@ in bar.clock.scrollUp = mkStrOption ""; bar.clock.showIcon = mkBoolOption true; bar.clock.showTime = mkBoolOption true; + bar.customModules.cava.showIcon = mkBoolOption true; + bar.customModules.cava.icon = mkStrOption ""; + bar.customModules.cava.spaceCharacter = mkStrOption " "; + bar.customModules.cava.barCharacters = mkStrListOption [ "▁" "▂" "▃" "▄" "▅" "▆" "▇" "█" ]; + bar.customModules.cava.showActiveOnly = mkBoolOption false; + bar.customModules.cava.bars = mkIntOption 10; + bar.customModules.cava.channels = mkIntOption 2; + bar.customModules.cava.framerate = mkIntOption 60; + bar.customModules.cava.samplerate = mkIntOption 44100; + bar.customModules.cava.autoSensitivity = mkBoolOption true; + bar.customModules.cava.lowCutoff = mkIntOption 50; + bar.customModules.cava.highCutoff = mkIntOption 10000; + bar.customModules.cava.noiseReduction = mkFloatOption 0.77; + bar.customModules.cava.stereo = mkBoolOption false; + bar.customModules.cava.leftClick = mkStrOption ""; + bar.customModules.cava.rightClick = mkStrOption ""; + bar.customModules.cava.middleClick = mkStrOption ""; + bar.customModules.cava.scrollUp = mkStrOption ""; + bar.customModules.cava.scrollDown = mkStrOption ""; bar.customModules.cpu.icon = mkStrOption ""; bar.customModules.cpu.label = mkBoolOption true; bar.customModules.cpu.leftClick = mkStrOption "";