diff --git a/nixosModules/ags-v2/config/eslint.config.ts b/nixosModules/ags-v2/config/eslint.config.ts index fdfb502a..48b1f19a 100644 --- a/nixosModules/ags-v2/config/eslint.config.ts +++ b/nixosModules/ags-v2/config/eslint.config.ts @@ -33,6 +33,10 @@ export default tseslint.config({ 'no-use-before-define': 'off', '@typescript-eslint/no-use-before-define': 'error', '@stylistic/indent-binary-ops': 'off', + '@stylistic/max-statements-per-line': [ + 'error', + { max: 2 }, + ], // Pre-flat config '@typescript-eslint/no-unused-vars': [ @@ -252,6 +256,7 @@ export default tseslint.config({ '@stylistic/brace-style': [ 'warn', 'stroustrup', + { allowSingleLine: true }, ], '@stylistic/comma-dangle': [ 'warn', diff --git a/nixosModules/ags-v2/config/services/brightness.ts b/nixosModules/ags-v2/config/services/brightness.ts index 6c660ba9..652cf1e9 100644 --- a/nixosModules/ags-v2/config/services/brightness.ts +++ b/nixosModules/ags-v2/config/services/brightness.ts @@ -103,6 +103,7 @@ class Brightness extends GObject.Object { this._screen = Number(await execAsync('brightnessctl g')) / Number(await execAsync('brightnessctl m')); + this.notify('screen'); } catch (_e) { console.error('missing dependancy: brightnessctl'); diff --git a/nixosModules/ags-v2/config/style/common.scss b/nixosModules/ags-v2/config/style/common.scss index 3208803c..b89ec0ea 100644 --- a/nixosModules/ags-v2/config/style/common.scss +++ b/nixosModules/ags-v2/config/style/common.scss @@ -30,6 +30,18 @@ progressbar { } } +circular-progress { + background: #363847; + min-height: 35px; + min-width: 35px; + font-size: 4px; + color: #79659f; + + &.disabled { + opacity: 0.5; + } +} + .widget { margin: 10px; padding: 5px; diff --git a/nixosModules/ags-v2/config/widgets/bar/_index.scss b/nixosModules/ags-v2/config/widgets/bar/_index.scss index 7d4bc058..e2250903 100644 --- a/nixosModules/ags-v2/config/widgets/bar/_index.scss +++ b/nixosModules/ags-v2/config/widgets/bar/_index.scss @@ -18,6 +18,10 @@ background-color: lighten(colors.$window_bg_color, 3%); } + &.network icon { + min-width: 30px; + } + &.battery icon { &.charging { color: green; diff --git a/nixosModules/ags-v2/config/widgets/bar/items/audio.tsx b/nixosModules/ags-v2/config/widgets/bar/items/audio.tsx new file mode 100644 index 00000000..63b3fcc6 --- /dev/null +++ b/nixosModules/ags-v2/config/widgets/bar/items/audio.tsx @@ -0,0 +1,28 @@ +import { bind } from 'astal'; + +import AstalWp from 'gi://AstalWp'; + +export default () => { + const speaker = AstalWp.get_default()?.audio.default_speaker; + + if (!speaker) { + throw new Error('Could not find default audio devices.'); + } + + return ( + + + muted ? 'disabled' : '')} + /> + + + + + ); +}; diff --git a/nixosModules/ags-v2/config/widgets/bar/items/brightness.tsx b/nixosModules/ags-v2/config/widgets/bar/items/brightness.tsx new file mode 100644 index 00000000..2fa0b8c2 --- /dev/null +++ b/nixosModules/ags-v2/config/widgets/bar/items/brightness.tsx @@ -0,0 +1,20 @@ +import { bind } from 'astal'; + +import Brightness from '../../../services/brightness'; + +export default () => { + return ( + + + + + + + + ); +}; diff --git a/nixosModules/ags-v2/config/widgets/bar/items/network.tsx b/nixosModules/ags-v2/config/widgets/bar/items/network.tsx new file mode 100644 index 00000000..513475c3 --- /dev/null +++ b/nixosModules/ags-v2/config/widgets/bar/items/network.tsx @@ -0,0 +1,53 @@ +import { bind, Variable } from 'astal'; +import { Gtk } from 'astal/gtk3'; + +import AstalNetwork from 'gi://AstalNetwork'; +const Network = AstalNetwork.get_default(); + + +export default () => { + const Hovered = Variable(false); + + return ( + + ); +}; diff --git a/nixosModules/ags-v2/config/widgets/bar/wim.tsx b/nixosModules/ags-v2/config/widgets/bar/wim.tsx index 0ea43ec2..143e2f90 100644 --- a/nixosModules/ags-v2/config/widgets/bar/wim.tsx +++ b/nixosModules/ags-v2/config/widgets/bar/wim.tsx @@ -1,8 +1,11 @@ import { Astal, Gtk } from 'astal/gtk3'; +import Audio from './items/audio'; import Battery from './items/battery'; +import Brightness from './items/brightness'; import Clock from './items/clock'; import CurrentClient from './items/current-client'; +import Network from './items/network'; import NotifButton from './items/notif-button'; import SysTray from './items/tray'; import Workspaces from './items/workspaces'; @@ -11,6 +14,7 @@ import BarRevealer from './fullscreen'; import Separator from '../misc/separator'; +// TODO: add Bluetooth, Kbd Layout export default () => ( ( + + + + +