Merge branch 'main' into ags-config
This commit is contained in:
commit
1f80786864
16 changed files with 324 additions and 138 deletions
23
home-manager/stvnliu/ags/config/hyprworkspaces.js
Normal file
23
home-manager/stvnliu/ags/config/hyprworkspaces.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
const hyprland = await Service.import("hyprland")
|
||||
|
||||
const dispatch = ws => hyprland.messageAsync(`dispatch workspace ${ws}`);
|
||||
|
||||
const Workspaces = () => Widget.EventBox({
|
||||
onScrollUp: () => dispatch('+1'),
|
||||
onScrollDown: () => dispatch('-1'),
|
||||
child: Widget.Box({
|
||||
children: Array.from({ length: 10 }, (_, i) => i + 1).map(i => Widget.Button({
|
||||
attribute: i,
|
||||
label: `${i}`,
|
||||
onClicked: () => dispatch(i),
|
||||
|
||||
class_name: i === hyprland.active.workspace.id ? "focused" : ""
|
||||
})),
|
||||
|
||||
// remove this setup hook if you want fixed number of buttons
|
||||
setup: self => self.hook(hyprland, () => self.children.forEach(btn => {
|
||||
btn.visible = hyprland.workspaces.some(ws => ws.id === btn.attribute);
|
||||
})),
|
||||
}),
|
||||
})
|
||||
export { Workspaces };
|
25
home-manager/stvnliu/ags/config/indicators.js
Normal file
25
home-manager/stvnliu/ags/config/indicators.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
const network = await Service.import("network")
|
||||
const WifiIndicator = () => Widget.Box({
|
||||
children: [
|
||||
Widget.Icon({
|
||||
icon: network.wifi.bind('icon_name'),
|
||||
}),
|
||||
Widget.Label({
|
||||
label: network.wifi.bind('ssid')
|
||||
.as(ssid => ssid || 'Unknown'),
|
||||
}),
|
||||
],
|
||||
})
|
||||
|
||||
const WiredIndicator = () => Widget.Icon({
|
||||
icon: network.wired.bind('icon_name'),
|
||||
})
|
||||
|
||||
const NetworkIndicator = () => Widget.Stack({
|
||||
children: {
|
||||
wifi: WifiIndicator(),
|
||||
wired: WiredIndicator(),
|
||||
},
|
||||
shown: network.bind('primary').as(p => p || 'wifi'),
|
||||
})
|
||||
export { NetworkIndicator };
|
|
@ -9,7 +9,10 @@
|
|||
source = ./config;
|
||||
};
|
||||
};
|
||||
home.packages = with pkgs; [ags];
|
||||
home.packages = with pkgs; [
|
||||
ags
|
||||
brightnessctl
|
||||
];
|
||||
myAutostartCommands = [
|
||||
#"${pkgs.ags}/bin/ags --init"
|
||||
"${pkgs.ags}/bin/ags"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue