ags: updates
All checks were successful
flake check / check (push) Successful in 9m47s
fmt check / check (push) Successful in 1m14s

This commit is contained in:
notohh 2024-01-03 17:08:17 -05:00
parent e192ba705e
commit a9626cfd89
Signed by: notohh
GPG key ID: BD47506D475EE86D
15 changed files with 117 additions and 35 deletions

View file

@ -7,6 +7,7 @@ import Audio from "resource:///com/github/Aylur/ags/service/audio.js";
import Hyprland from "resource:///com/github/Aylur/ags/service/hyprland.js"; import Hyprland from "resource:///com/github/Aylur/ags/service/hyprland.js";
import Network from "resource:///com/github/Aylur/ags/service/network.js"; import Network from "resource:///com/github/Aylur/ags/service/network.js";
import SystemTray from "resource:///com/github/Aylur/ags/service/systemtray.js"; import SystemTray from "resource:///com/github/Aylur/ags/service/systemtray.js";
import Mpris from 'resource:///com/github/Aylur/ags/service/mpris.js';
export { export {
App, App,
@ -18,4 +19,5 @@ export {
Utils, Utils,
Variable, Variable,
Widget, Widget,
Mpris,
}; };

View file

@ -1,26 +1,31 @@
import { Widget } from '../import.js'; import { Widget } from '../import.js';
import { Time } from './widgets/time.js' import { Time } from './widgets/time.js'
import { nixosLogo } from './widgets/image.js'; import { nixosLogo } from './widgets/images/image.js';
import { Media } from './widgets/music.js';
import { Workspaces } from './widgets/hyprland.js';
const Start = () => Widget.Box({ const Start = () => Widget.Box({
hpack: "start", hpack: "start",
children: [ children: [
nixosLogo() nixosLogo(),
Workspaces(),
] ]
}) });
const Center = () => Widget.Box({ const Center = () => Widget.Box({
children: [] children: [
}) Media(),
]
});
const End = () => Widget.Box({ const End = () => Widget.Box({
hpack: "end", hpack: "end",
children: [ children: [
Time() Time(),
] ]
}) });
const Bar = (monitor) => Widget.Window({ const Bar = (monitor) => Widget.Window({
monitor, monitor,
name: `bar-${monitor}`, name: `bar`,
anchor: ['top', 'left', 'right'], anchor: ['top', 'left', 'right'],
exclusivity: 'exclusive', exclusivity: 'exclusive',
child: Widget.CenterBox({ child: Widget.CenterBox({
@ -28,7 +33,7 @@ const Bar = (monitor) => Widget.Window({
centerWidget: Center(), centerWidget: Center(),
endWidget: End(), endWidget: End(),
}), }),
}) });
export { export {
Bar Bar

View file

@ -0,0 +1,17 @@
import { Hyprland, Widget } from "../../import.js";
const Workspaces = () => Widget.Box({
class_name: 'workspaces',
children: Hyprland.bind('workspaces').transform(ws => {
return ws.map(({ id }) => Widget.Button({
on_clicked: () => Hyprland.sendMessage(`dispatch workspace ${id}`),
child: Widget.Label(`${id}`),
class_name: Hyprland.active.workspace.bind('id')
.transform(i => `${i === id ? 'focused' : ''}`),
}));
}),
});
export {
Workspaces
}

View file

@ -1,9 +0,0 @@
import { Widget } from '../../import.js';
const nixosLogo = () => Widget.Icon({
icon: '/home/notoh/Pictures/icons/nixos.png'
});
export {
nixosLogo
}

View file

@ -0,0 +1,9 @@
import { Widget } from '../../../import.js';
const nixosLogo = () => Widget.Icon({
icon: '/home/notoh/snowflake/home/ags/config/js/widgets/images/static/nixos.png'
});
export {
nixosLogo
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View file

@ -0,0 +1,17 @@
import { Widget, Mpris } from "../../import.js";
const Media = () => Widget.Box({
class_name: 'media',
child: Widget.Label('-').hook(Mpris, self => {
if (Mpris.players[0]) {
const { track_artists, track_title } = Mpris.players[0];
self.label = `${track_artists.join(', ')} - ${track_title}`;
} else {
self.label = 'Nothing is playing';
}
}, 'player-changed'),
});
export {
Media
}

View file

View file

@ -1,7 +1,7 @@
import { Widget, Utils } from '../../import.js'; import { Widget, Utils } from '../../import.js';
const Time = () => Widget.EventBox({ const Time = () => Widget.Box({
child: Widget.Label({ child: Widget.Label({
className: "date" className: "date"
}).poll( }).poll(

View file

@ -1,2 +1,9 @@
@import 'scss/bar.scss'; @import 'scss/bar.scss';
@import 'scss/general.scss'; @import 'scss/general.scss';
@import 'scss/widgets.scss';
* {
all: unset;
margin: 3px;
font-family: 'Monaspace Krypton';
}

View file

@ -1,9 +1,5 @@
* { @import 'colors.scss';
all: unset;
margin: 3px;
font-family: 'Monaspace Krypton';
}
window { window {
background-color: black; background-color: $background;
} }

View file

@ -0,0 +1,24 @@
/* tokyonight */
$red: #f7768e;
$orange: #ff9e64;
$yellow: #e0af68;
$light-green: #9ece6a;
$green: #73daca;
$turquoise: #89ddff;
$light-cyan: #b4f9f8;
$teal: #2ac3de;
$cyan: #7dcfff;
$blue: #7aa2f7;
$magenta: #bb9af7;
$white: #c0caf5;
$light-gray: #9aa5ce;
$parameters: #cfc9c2;
$comment: #565f89;
$black: #414868;
$foreground: #a9b1d6;
$foreground-highlight: #c0caf5;
$foreground-gutter: #363b54;
$background: #1a1b26;
$background-highlight: #30374b;
$background-menu: #16161e;

View file

@ -1,7 +0,0 @@
.date {
color: #ffffff;
}
image {
font-size: 24px;
}

View file

@ -0,0 +1,21 @@
@import 'colors.scss';
@mixin widget {
color: $white
};
.date {
@include widget();
}
.workspaces {
@include widget();
};
.media {
@include widget();
}
image {
font-size: 24px;
}

View file

@ -7,7 +7,7 @@
in { in {
programs.ags = { programs.ags = {
enable = true; enable = true;
extraPackages = with pkgs; [libsoup_3]; extraPackages = with pkgs; [libsoup_3 libdbusmenu-gtk3];
}; };
home.packages = with pkgs; [dart-sass]; home.packages = with pkgs; [dart-sass];
xdg.configFile = { xdg.configFile = {