aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--home-manager/stvnliu/ags/config/config.js4
-rw-r--r--home-manager/stvnliu/ags/config/hyprworkspaces.js23
-rw-r--r--home-manager/stvnliu/ags/config/indicators.js25
-rw-r--r--home-manager/stvnliu/hypr/hyprland.nix6
4 files changed, 54 insertions, 4 deletions
diff --git a/home-manager/stvnliu/ags/config/config.js b/home-manager/stvnliu/ags/config/config.js
index cd36bde..2197887 100644
--- a/home-manager/stvnliu/ags/config/config.js
+++ b/home-manager/stvnliu/ags/config/config.js
@@ -17,7 +17,7 @@ const focusedTitle = Widget.Label({
visible: hyprland.active.client.bind('address')
.as(addr => addr !== "0x"),
})
-
+const wsSymbols = ["壹", "貳", "叁", "肆", "伍", "陸", "柒", "捌", "玖", "拾"]
const dispatch = ws => hyprland.messageAsync(`dispatch workspace ${ws}`);
const Workspaces = () => Widget.EventBox({
@@ -26,7 +26,7 @@ const Workspaces = () => Widget.EventBox({
child: Widget.Box({
children: Array.from({ length: 10 }, (_, i) => i + 1).map(i => Widget.Button({
attribute: i,
- label: `${i}`,
+ label: `${wsSymbols[i - 1]}`,
onClicked: () => dispatch(i),
class_name: i === hyprland.active.workspace.id ? "focused" : ""
diff --git a/home-manager/stvnliu/ags/config/hyprworkspaces.js b/home-manager/stvnliu/ags/config/hyprworkspaces.js
new file mode 100644
index 0000000..4504d7c
--- /dev/null
+++ b/home-manager/stvnliu/ags/config/hyprworkspaces.js
@@ -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 };
diff --git a/home-manager/stvnliu/ags/config/indicators.js b/home-manager/stvnliu/ags/config/indicators.js
new file mode 100644
index 0000000..0713b31
--- /dev/null
+++ b/home-manager/stvnliu/ags/config/indicators.js
@@ -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 };
diff --git a/home-manager/stvnliu/hypr/hyprland.nix b/home-manager/stvnliu/hypr/hyprland.nix
index d9e4516..b5199fd 100644
--- a/home-manager/stvnliu/hypr/hyprland.nix
+++ b/home-manager/stvnliu/hypr/hyprland.nix
@@ -78,8 +78,10 @@
"$mod, F, fullscreen"
"$mod, E, exec, ${pkgs.pcmanfm}/bin/pcmanfm"
# foot terminal
- "$mod, Return, exec, ${terminalCmd}"
- "$mod SHIFT, Return, exec, [float] ${terminalCmd}"
+ "$mod, Return, exec, ${terminalCmd} ${config.myShells.defaultShell}"
+ "$mod SHIFT, Return, exec, [float] ${terminalCmd} ${config.myShells.defaultShell}"
+
+ "$mod, N, exec, [float] ${terminalCmd} ${pkgs.networkmanager}/bin/nmtui"
# vimkeys navigation
"$mod, H, movefocus, l"