summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornoname <[email protected]>2025-03-07 18:26:23 +1100
committernoname <[email protected]>2025-03-07 18:26:23 +1100
commita87addb63e62e6dc16fa976f0a633c74e12b035e (patch)
tree4b0f12af776c0ac89160c4814307b614c1933b95
parent4b7e91493c900028dc6120d55005f51d5242be02 (diff)
finalize project
-rw-r--r--docs/guide/libraries/references.md1
-rw-r--r--docs/guide/libraries/sway.md41
-rw-r--r--docs/vitepress.config.ts1
-rw-r--r--flake.nix2
-rw-r--r--lib/sway/cli.vala12
5 files changed, 50 insertions, 7 deletions
diff --git a/docs/guide/libraries/references.md b/docs/guide/libraries/references.md
index f8ab4d8..09805a7 100644
--- a/docs/guide/libraries/references.md
+++ b/docs/guide/libraries/references.md
@@ -43,3 +43,4 @@ Reading their documentation will vary depending on the language they are used in
- [River](https://aylur.github.io/libastal/river): Library and cli tool for getting status information of the river wayland compositor
- [Tray](https://aylur.github.io/libastal/tray): A systemtray library and cli tool
- [WirePlumber](https://aylur.github.io/libastal/wireplumber): A library for audio control using wireplumber
+- [Sway](https://aylur.github.io/libastal/hyprland): Library and cli tool for sway IPC socket
diff --git a/docs/guide/libraries/sway.md b/docs/guide/libraries/sway.md
new file mode 100644
index 0000000..8424255
--- /dev/null
+++ b/docs/guide/libraries/sway.md
@@ -0,0 +1,41 @@
+# Sway
+
+Library and CLI tool for monitoring the Sway socket.
+
+## Usage
+
+You can browse the [sway reference](https://aylur.github.io/libastal/sway).
+
+## Installation
+
+1. install dependencies
+
+:::code-group
+
+```sh [<i class="devicon-archlinux-plain"></i> Arch]
+sudo pacman -Syu meson vala json-glib gobject-introspection
+```
+
+```sh [<i class="devicon-fedora-plain"></i> Fedora]
+sudo dnf install meson gcc valac json-glib-devel gobject-introspection-devel
+```
+
+```sh [<i class="devicon-ubuntu-plain"></i> Ubuntu]
+sudo apt install meson valac libjson-glib-dev gobject-introspection
+```
+
+:::
+
+2. clone repo
+
+```sh
+git clone https://github.com/aylur/astal.git
+cd astal/lib/sway
+```
+
+3. install
+
+```sh
+meson setup build
+meson install -C build
+```
diff --git a/docs/vitepress.config.ts b/docs/vitepress.config.ts
index 3593b40..835a8b9 100644
--- a/docs/vitepress.config.ts
+++ b/docs/vitepress.config.ts
@@ -114,6 +114,7 @@ export default defineConfig({
{ text: "Notifd", link: "/guide/libraries/notifd" },
{ text: "PowerProfiles", link: "/guide/libraries/powerprofiles" },
{ text: "River", link: "/guide/libraries/river" },
+ { text: "Sway", link: "/guide/libraries/sway" },
{ text: "Tray", link: "/guide/libraries/tray" },
{ text: "WirePlumber", link: "/guide/libraries/wireplumber" },
],
diff --git a/flake.nix b/flake.nix
index cea2a6a..b1d502d 100644
--- a/flake.nix
+++ b/flake.nix
@@ -35,9 +35,9 @@
notifd = mkPkg ./lib/notifd;
powerprofiles = mkPkg ./lib/powerprofiles;
river = mkPkg ./lib/river;
+ sway = mkPkg ./lib/sway;
tray = mkPkg ./lib/tray;
wireplumber = mkPkg ./lib/wireplumber;
- sway = mkPkg ./lib/sway;
gjs = import ./lang/gjs {inherit self pkgs;};
});
diff --git a/lib/sway/cli.vala b/lib/sway/cli.vala
index 19cf5ca..f52eb79 100644
--- a/lib/sway/cli.vala
+++ b/lib/sway/cli.vala
@@ -1,11 +1,9 @@
static bool help;
static bool version;
-static bool test;
const OptionEntry[] options = {
{ "version", 'v', OptionFlags.NONE, OptionArg.NONE, ref version, null, null },
{ "help", 'h', OptionFlags.NONE, OptionArg.NONE, ref help, null, null },
- { "test", 't', OptionFlags.NONE, OptionArg.NONE, ref test, null, null },
// { "monitor", 'm', OptionFlags.NONE, OptionArg.NONE, ref monitor, null, null },
{ null },
};
@@ -22,10 +20,12 @@ int main(string[] argv) {
return 1;
}
- if (test) {
- var loop = new MainLoop();
- AstalSway.get_default();
- loop.run();
+ if (help) {
+ print("Usage:\n");
+ print(" %s [flags]\n\n", argv[0]);
+ print("Flags:\n");
+ print(" -h, --help Print this help and exit\n");
+ print(" -v, --version Print version number and exit\n");
return 0;
}