Skip to content

Kailokk/sway-workspace-watcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sway Workspace Watcher

A miniscule app that will listen for sway events, and output the current state of workspaces at the time of the event.

Sample Output
[
    {
        "name": "1",
        "output": "DVI-D-1",
        "visible": false,
        "urgent": false,
        "focused": false
    },
    {
        "name": "2",
        "output": "DVI-D-1",
        "visible": true,
        "urgent": false,
        "focused": true
    },
    {
        "name": "3",
        "output": "HDMI-A-1",
        "visible": true,
        "urgent": true,
        "focused": false
    }
]

Installation

Nix Flake

You can include the project as part of a flake like so:

{
 inputs = {
  nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";

  home-manager = {
   url = "github:nix-community/home-manager/release-23.11";
   inputs.nixpkgs.follows = "nixpkgs";
  };

  sway-workspace-watcher.url = "github:kailokk/sway-workspace-watcher";
 };
}

Then simply add this line to your configuration:

environment.systemPackages = [ inputs.sway-workspace-watcher.packages.${pkgs.system}.default ];

Crates/Cargo

You can build/install this package directly using cargo:

cargo install --git "https://github.com/Kailokk/sway-workspace-watcher"

Useage

Once install simply run

sway-workspace-watcher

And the program will output the current workspace configuration, every time a state is changed. The output will order the list with the following hierarchy:

  • Workspace name (if parseable to a number)
  • Underlying sway workspace id

Contributions

This is intended as a very small app to help me bridge the gap between sway and eww, to display the workspace state. That being said, if you have any suggestions for improvements or features, I would love to hear them! :)

About

A small watcher program to bridge sway to eww

Topics

Resources

License

Stars

Watchers

Forks