A window swallower for swaywm

Related tags

GUI swayhide
Overview

swayhide - A window swallower for sway

Description

swayhide hides the currently active terminal (by moving it to the scratchpad), then it executes the supplied command. When the child process has finished, the terminal is moved back. This is incredibly useful if your workflow includes opening graphical programs from the terminal, as the "locked" terminal won't have to take up any space.

Ideally this would be done using wlroots instead of swayipc, but I'm too lazy to figure out how that works.

This project will be deprecated when I find/build a wlroots alternative, since that would make it wm-independent and thus more future proof.

This project is heavily inspired by jamesofarrell/i3-swallow

Usage

$ swayhide firefox
$ alias hide="swayhide"
$ hide zathura document.pdf
$ hide "imv image.jpg"

Installation

$ cargo install swayhide

Building from source

$ git clone https://github.com/NomisIV/swayhide
$ cd swayhide
$ cargo install --path .

TODO

  • Shell completions (how to bundle completion files?)

Contributions are very welcome :)

Comments
  • Fish shell completions

    Fish shell completions

    Hey there!

    Currently there are no shell completions for swayhide, since I am a fish-shell user I thought I'd write my own and share them here.

    I am making this an issue instead of a PR as I'm unsure where and wether or not you want this in the repo.

    The full completion file swayhide.fish:

    #
    # Completions for swayhide
    #
    
    complete -c swayhide -s h -l help -d "Display help and exit"
    complete -c swayhide -xa "(__fish_complete_subcommand)"
    
    opened by tosti007 6
  • PoC: Make sure the new window replaces the current

    PoC: Make sure the new window replaces the current

    This is not at all ready to be merged, but is an experiment trying to implement #1.

    By converting the original window into a split, the newly-created window is added to that split (which guarantees that they're adjacent). Since the original window is then hidden, the new window effectively takes its place.

    This has a few caveats:

    • There's a "wait 1s" hardcoded there:
      • If the new window is faster, this is weird and glitchy.
      • If the new window is slower, this doesn't work.
    • When the new window exits, the swallowed window won't always take its place: it'll be placed relative to the last-focused window, and I can't think of any way around this other than continuously monitoring the tree to find our right position.

    The timeout can we worked around by waiting for any window to appear, and assuming the first new window to spawn is the one we're creating. This might be flaky, but I suspect it'd work 90% of the time.

    An alternative implementation could also be using a new stacked/tabbed layout, where the new window is a second in that container. If sway allowed us to hide the stack/tab bar on that container, we'd be 100% covered.

    opened by WhyNotHugo 4
  • Clarify license

    Clarify license

    Firstly, thanks so much for your work on this project! I'd love to package it for the alpine linux repos, but in order to do so I need to clarify that this is free software. Would you be willing to pick a license and put it on the repo? GPLv3+ or MIT might be good choices :)

    opened by eddsalkield 2
  • Compiling on aarch64/musl

    Compiling on aarch64/musl

    Hey there, I tried installing with both cargo as well as compiling the source but I get greeted with the following message:

    error: failed to compile `swayhide v0.2.1 (/root/swayhide)`, intermediate artifacts can be found at `/root/swayhide/target`
    
    Caused by:
      cannot produce proc-macro for `failure_derive v0.1.8` as the target `aarch64-unknown-linux-musl` does not support these crate types
    

    Been wondering if proc-macro is any easy to substitute with an alternative so I could maybe get it running on my machine.

    opened by ktzo 1
  • New window does not replace the existing window

    New window does not replace the existing window

    Say I have a vertical split like so:

    | terminal | tabbed[multiple windows] |
    

    If I run swayhide something on my terminal, the terminal disappears, and the new window appears as a child of the container on the right.

    I kind of expected swayhide to replace my current window with the new one, rather than spawn the new one elsewhere.

    I think this can be achieved by:

    • mark original window
    • split h
    • spawn new window
    • move marked to scratchpad
    • split none

    The result is that the new window is dropped into the same place as the original one, with affecting the exterior layout at all.

    What are your thoughts on this? Does the idea/feature/change make sense?

    opened by WhyNotHugo 1
  • Terminal jumps to another display on multi-monitor setup

    Terminal jumps to another display on multi-monitor setup

    I think the title of this issue is pretty self-explanatory.

    When I run swayhide somethingsomething, after I close the program I just ran, the terminal from which the program was originally spawned jumps to a different monitor than the one I'm focused on. This happens on either monitor, i.e. it will jump to the second one.

    I'm not sure what would happen on a three-monitor setup.

    Ok, I built the program myself, but after testing both the master and AUR versions, they both don't have this bug. Strange... Will see if I can reproduce consistently.

    opened by wildwestrom 2
Releases(v0.2.1)
  • v0.2.1(Jun 10, 2022)

    Highlights:

    • https://github.com/NomisIV/swayhide/commit/e8e91359e8c43bf2ff7cf39d53318f4236400191 AUR package
    • https://github.com/NomisIV/swayhide/commit/74f3437123610ac6eaa58784051e30d2524c01ac Wait until child windows spawns
    • https://github.com/NomisIV/swayhide/commit/9ae76ade470832aa438666f3ed31ad5e5e67056b Add license
    • https://github.com/NomisIV/swayhide/commit/9fb8e5232657aaeac12db385f50a903ac58ca77b Add completions
    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Jul 30, 2021)

    What's new:

    • Added help/usage page
    • swayhide now supports reading the command as a string
    • Added README to crate

    Install from crates.io: cargo install swayhide

    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Jul 30, 2021)

Owner
NomisIV
The salt in the C is what made the bare metal Rust
NomisIV
A floating, tag-based window manager written in Rust

worm worm is a floating, tag-based window manager for X11. It is written in the Rust programming language, using the X11RB library. Install cargo buil

null 627 Jan 4, 2023
D3D9 Window overlay written in Rust

win-overlay (-rs) DirectX overlay written in Rust for various projects, wanted to easily create overlays across projects so decided to write my own im

Zor 18 Dec 28, 2022
Generic tiling window manager library in Rust

Pop Tiler Generic tiling window manager library for Rust, using an architecture based on GhostCell. License Licensed under the GNU Lesser General Publ

Pop!_OS 65 Dec 29, 2022
A window manager coded in rust

Tailwin A window manager coded in rust Thanks Victoruler for making the logo under a cc-by licence.

Arthur Melton 3 Jul 27, 2022
skyWM is an extensible tiling window manager written in Rust

skyWM is an extensible tiling window manager written in Rust. skyWM has a clear and distinct focus adhering to the KISS and Unix philosophy.

Chadano 74 Dec 28, 2022
Provides event handling for egui in SDL2 window applications.

egui-sdl2-event Provides event handling for egui when SDL2 is used as the windowing system. This crate does not perform any rendering, but it can be c

Valtteri Vallius 8 Feb 15, 2023
skyWM is an extensible tiling window manager written in Rust

skyWM is an extensible tiling window manager written in Rust. skyWM has a clear and distinct focus adhering to the KISS and Unix philosophy.

Orbital 76 Apr 22, 2023
بو النوافذ is a personal Window manager

عربي؟ كمل قراءة بالعربي (لهجة سعودية). Bunnuafeth | بو النوافذ Bunnuafeth is a personal Window manager written in Rust General philosophy This window

Salman Abuhaimed 4 Oct 4, 2023
Easy c̵̰͠r̵̛̠ö̴̪s̶̩̒s̵̭̀-t̶̲͝h̶̯̚r̵̺͐e̷̖̽ḁ̴̍d̶̖̔ ȓ̵͙ė̶͎ḟ̴͙e̸̖͛r̶̖͗ë̶̱́ṉ̵̒ĉ̷̥e̷͚̍ s̷̹͌h̷̲̉a̵̭͋r̷̫̊ḭ̵̊n̷̬͂g̵̦̃ f̶̻̊ơ̵̜ṟ̸̈́ R̵̞̋ù̵̺s̷̖̅ţ̸͗!̸̼͋

Rust S̵̓i̸̓n̵̉ I̴n̴f̶e̸r̵n̷a̴l mutability! Howdy, friendly Rust developer! Ever had a value get m̵̯̅ð̶͊v̴̮̾ê̴̼͘d away right under your nose just when

null 294 Dec 23, 2022
Let Tauri's transparent background rendering window be stacked on Bevy's rendering window in real time to run the game with native-level performance!

Native Bevy with Tauri HUD DEMO 将 Tauri 的透明背景渲染窗口实时叠在 Bevy 的渲染窗口上,以使用原生级别性能运行游戏! Let Tauri's transparent background rendering window be stacked on Bev

伊欧 3 Mar 25, 2024
A tiling window manager for Windows 10 based on binary space partitioning

yatta BSP Tiling Window Manager for Windows 10 Getting Started This project is still heavily under development and there are no prebuilt binaries avai

Jade 143 Nov 12, 2022
Cross-platform Window library in Rust for Tauri. [WIP]

Cross-platform application window creation library in Rust that supports all major platforms like Windows, macOS, Linux, iOS and Android. Built for you, maintained for Tauri.

Tauri 899 Jan 1, 2023
A library that creates a terminal-like window with feature-packed drawing of text and easy input handling. MIRROR.

BearLibTerminal provides a pseudoterminal window with a grid of character cells and a simple yet powerful API for flexible textual output and uncompli

Tommy Ettinger 43 Oct 31, 2022
StarWM is an extensible window manager written in Rust.

StarWM is an extensible, floating and tiling, X window manager for Linux-based operating systems written in Rust.

StarWM 30 Dec 9, 2022
A tiling window manager for Windows

komorebi Tiling Window Management for Windows. About komorebi is a tiling window manager that works as an extension to Microsoft's Desktop Window Mana

Jade (جاد) 2.6k Jan 1, 2023
A floating, tag-based window manager written in Rust

worm worm is a floating, tag-based window manager for X11. It is written in the Rust programming language, using the X11RB library. Install cargo buil

null 627 Jan 4, 2023
D3D9 Window overlay written in Rust

win-overlay (-rs) DirectX overlay written in Rust for various projects, wanted to easily create overlays across projects so decided to write my own im

Zor 18 Dec 28, 2022
Generic tiling window manager library in Rust

Pop Tiler Generic tiling window manager library for Rust, using an architecture based on GhostCell. License Licensed under the GNU Lesser General Publ

Pop!_OS 65 Dec 29, 2022
A window manager coded in rust

Tailwin A window manager coded in rust Thanks Victoruler for making the logo under a cc-by licence.

Arthur Melton 3 Jul 27, 2022
My Window Manager

mwm My window manager that is a work in progress. Currently hacky Installation Clone this repo then: cargo build --release Put the binary in your pat

Monroe Clinton 5 Dec 14, 2022