GithubHelp home page GithubHelp logo

staaas / sway-move-here Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 16 KB

Helper tool to move all the workspaces to the current output in Sway window manager

Home Page: https://git.sr.ht/~staaas/sway-move-here

Rust 100.00%

sway-move-here's Introduction

sway-move-here

sway-move-here is a helper tool to move all the workspaces to the current output in Sway window manager.

In a nutshell it does the following:

  1. Retrieve all the outputs (displays) and workspaces.
  2. Move all the workspaces to the output that is currently focused.
  3. Switch back to the workspace that was originally focused.

The project is developed on sourcehut, there is also a github mirror.

Usage

Just run sway-move-here binary after building it.

One can also bind it to a key combo in Sway config (see man 5 sway), e.g.:

bindsym --to-code $mod+Control+apostrophe exec --no-startup-id /path/to/sway-move-here

If the tool doesn't work as expected, one can increase output verbosity:

  • flag -v will display swaymsg commands and their exit codes
  • flag -vv will additionally print standard output of those commands

Building

The tool is written in Rust lang 2018 edition, uses Cargo as a build tool and rustup as a toolchain manager.

The tool is statically compiled using musl by default, so one'll need to install the appropriate target first:

rustup component add x86_64-unknown-linux-musl

Once that is done once, the tool can be built using Cargo:

cargo build --release

Binary target/x86_64-unknown-linux-musl/release/sway-move-here can now be copied to any location.

Testing

The tool doesn't have automated tests (yet), but it works. I swear!

sway-move-here's People

Contributors

staaas avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.