Merge branch 'master' into master

This commit is contained in:
Ben
2025-01-13 20:18:10 +10:00
committed by GitHub
6 changed files with 35 additions and 8 deletions

View File

@@ -81,7 +81,7 @@
if [ "$#" -eq 0 ]; then if [ "$#" -eq 0 ]; then
exec ${self.packages.${final.stdenv.system}.default}/bin/hyprpanel exec ${self.packages.${final.stdenv.system}.default}/bin/hyprpanel
else else
exec ${ags.packages.${final.stdenv.system}.io}/bin/astal -i hyprpanel "$@" exec ${ags.packages.${final.stdenv.system}.io}/bin/astal -i hyprpanel "$*"
fi fi
''; '';
}; };

View File

@@ -25,6 +25,8 @@ let
mkStrOption = default: mkOption { type = types.str; default = default; }; mkStrOption = default: mkOption { type = types.str; default = default; };
mkIntOption = default: mkOption { type = types.int; default = default; }; mkIntOption = default: mkOption { type = types.int; default = default; };
mkBoolOption = default: mkOption { type = types.bool; 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 # TODO: Please merge https://github.com/Jas-SinghFSU/HyprPanel/pull/497
# Do not ask what these do... # Do not ask what these do...
@@ -151,6 +153,25 @@ in
bar.clock.scrollUp = mkStrOption ""; bar.clock.scrollUp = mkStrOption "";
bar.clock.showIcon = mkBoolOption true; bar.clock.showIcon = mkBoolOption true;
bar.clock.showTime = 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.icon = mkStrOption "";
bar.customModules.cpu.label = mkBoolOption true; bar.customModules.cpu.label = mkBoolOption true;
bar.customModules.cpu.leftClick = mkStrOption ""; bar.customModules.cpu.leftClick = mkStrOption "";

View File

@@ -38,7 +38,13 @@ const Bluetooth = (): BarBoxChild => {
); );
const componentBinding = Variable.derive( 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 => { (showLabel: boolean, isPowered: boolean, devices: AstalBluetooth.Device[]): JSX.Element => {
if (showLabel) { if (showLabel) {
return ( return (

View File

@@ -7,12 +7,11 @@ import { BarBoxChild } from 'src/lib/types/bar.js';
import { runAsyncCommand, throttledScrollHandler } from 'src/components/bar/utils/helpers.js'; import { runAsyncCommand, throttledScrollHandler } from 'src/components/bar/utils/helpers.js';
import { bind, Variable } from 'astal'; import { bind, Variable } from 'astal';
import { onMiddleClick, onPrimaryClick, onScroll, onSecondaryClick } from 'src/lib/shared/eventHandlers'; 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 { show_total, rightClick, middleClick, scrollUp, scrollDown, hideCountWhenZero } = options.bar.notifications;
const { ignore } = options.notifications; const { ignore } = options.notifications;
const notifs = AstalNotifd.get_default();
export const Notifications = (): BarBoxChild => { export const Notifications = (): BarBoxChild => {
const componentClassName = Variable.derive( const componentClassName = Variable.derive(
[bind(options.theme.bar.buttons.style), bind(show_total)], [bind(options.theme.bar.buttons.style), bind(show_total)],
@@ -29,8 +28,8 @@ export const Notifications = (): BarBoxChild => {
const boxChildren = Variable.derive( const boxChildren = Variable.derive(
[ [
bind(notifs, 'notifications'), bind(notifdService, 'notifications'),
bind(notifs, 'dontDisturb'), bind(notifdService, 'dontDisturb'),
bind(show_total), bind(show_total),
bind(ignore), bind(ignore),
bind(hideCountWhenZero), bind(hideCountWhenZero),

View File

@@ -2,7 +2,7 @@ import options from 'src/options';
import { Module } from '../../shared/Module'; import { Module } from '../../shared/Module';
import { inputHandler } from 'src/components/bar/utils/helpers'; import { inputHandler } from 'src/components/bar/utils/helpers';
import { BarBoxChild } from 'src/lib/types/bar'; import { BarBoxChild } from 'src/lib/types/bar';
import { bind } from 'astal'; import { bind, Variable } from 'astal';
import { Astal } from 'astal/gtk3'; import { Astal } from 'astal/gtk3';
const { icon, leftClick, rightClick, middleClick, scrollUp, scrollDown } = options.bar.customModules.power; const { icon, leftClick, rightClick, middleClick, scrollUp, scrollDown } = options.bar.customModules.power;
@@ -11,6 +11,7 @@ export const Power = (): BarBoxChild => {
const powerModule = Module({ const powerModule = Module({
tooltipText: 'Power Menu', tooltipText: 'Power Menu',
textIcon: bind(icon), textIcon: bind(icon),
showLabelBinding: Variable(false),
boxClass: 'powermodule', boxClass: 'powermodule',
props: { props: {
setup: (self: Astal.Button) => { setup: (self: Astal.Button) => {

View File

@@ -99,7 +99,7 @@ export function icon(name: string | null, fallback = icons.missing): string {
if (lookUpIcon(icon)) return icon; 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; return fallback;
} }