Add ags launcher

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-07-02 16:43:50 +03:00
parent 30d56ebf00
commit 6809acf2ae
7 changed files with 84 additions and 25 deletions

View File

@@ -1,4 +1,6 @@
import gap from './gap/gap';
import date from './date/date';
import launcher from './launcher/launcher';
import workspace from './workspace/workspace';
export default (monitor: number) => Widget.Window({
@@ -8,11 +10,13 @@ export default (monitor: number) => Widget.Window({
exclusivity: 'exclusive',
anchor: ['top', 'right', 'left'],
child: Widget.CenterBox({
css: 'min-width: 2px; min-height: 2px; padding-top: 2px; padding-bottom: 2px;',
class_name: 'widgets',
// eslint-disable-next-line @typescript-eslint/naming-convention
startWidget: Widget.Box({
hexpand: true,
children: [
launcher(),
gap(),
workspace(),
],
}),

View File

@@ -6,8 +6,13 @@ const clock = Variable(glib.DateTime.new_now_local(), {
const time = Utils.derive([clock], (c) => c.format('%H:%M - %A, %d %B %Y') || '');
export default () => Widget.Label({
const label = () => Widget.Label({
class_name: 'label',
justification: 'center',
label: time.bind(),
});
export default () => Widget.EventBox({
class_name: 'date',
child: label(),
});

View File

@@ -0,0 +1,3 @@
export default () => Widget.Box({
class_name: 'gap',
});

View File

@@ -0,0 +1,10 @@
const icon = () => Widget.Icon({
class_name: 'icon',
icon: "nix-snowflake-symbolic",
});
export default () => Widget.EventBox({
class_name: 'launcher',
on_primary_click: () => Utils.execAsync('bash -c "rofi -cache-dir $XDG_CACHE_HOME/rofi -show drun"'),
child: icon(),
});