Code Monkey home page Code Monkey logo

waycorner's Introduction

waycorner

Hot corners for Wayland. Create anchors in the corners of your monitors and execute a command of your choice.

Note: Currently only tested on swaywm. Though it should work on any Wayland compositor that supports the xdg-output protocol.

swaylock-example.mp4

Installation

If you would like waycorner to be available on your distro's package manager, feel free to make an issue if you have some time to help.

Arch User Repository (AUR)

paru -S waycorner

Cargo (crates.io)

cargo install waycorner --locked

Manually

git clone [email protected]:AndreasBackx/waycorner.git
cd waycorner
cargo install --path . --locked

Configuration

Default configuration location is ~/.config/waycorner/config.toml, this needs to be created manually. You can also specify a different location using --config. Preview your configuration with the --preview flag.

[left]
# Shell commands to execute when hotcorner is triggered,
# at least one is required.

# Command to run when cursor enters hotcorner.
# `command` is an alias for `enter_command`.
enter_command = [ "notify-send", "enter" ]
# Command to run when cursor exits hotcorner.
exit_command = [ "notify-send", "exit" ]

# Locations of the hot corners.
# Options:
# - for corners: top_left, top_right, bottom_right, and bottom_left;
# - for edges: top, bottom, right, left.
locations = ["bottom_right", "bottom_left"]  # default

# Size of the hot corners in pixels, for edges the size means the width
# for vertical edges, and height for horizontal edges. The other dimension
# will be the width/height of your display - the set margin.
size = 10  # default

# Margin on the sides of the hot edges, only applicable to edge locations.
# See the comment with sizes attribute above.
margin = 20  # default

# Timeout in milliseconds before command is triggered.
timeout_ms = 250  # default

# Hex color of the corner when previewed, supports transparency. (#AARRGGBB or #RRGGBB)
# (Useful for debuging purposes when setting up several hot corners.)
color = #FFFF0000  # default

# Optional output config to specify what output to use.
[left.output]
# Regex to match output descriptions on.
# Regex engine is similar to RE2: https://github.com/rust-lang/regex
#
# Use `swaymsg -t get_outputs` to get a list of outputs in the format:
# Output ${NAME} '${DESCRIPTION}'
description = ""  # default, empty means all outputs

Then add exec waycorner to your swaywm config.

Logging

Pass RUST_LOG with either trace, debug, info, warn, or error. To set the logging level, default is error. See env_logger documentation.

waycorner's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

waycorner's Issues

Expand across screen width or place in center

I want to use waycorner as a way to show and hide waybar, sort of how a dock works, wanted to know if it was possible to have the activation area for across the width of my screen or have an option to place the hot corner in the center rather than in the corners

core dumped

Arch Linux 6.1.8
Wayland 1.21.0
Sway 1.8

❯ waycorner
[wayland-client error] Attempted to dispatch unknown opcode 0 for wl_shm, aborting.
zsh: IOT instruction (core dumped)  waycorner

[Feature Request] Support for enterring and exiting hot corners

It appears a command can only be triggered on entering the corner. Would it be possible to also detect leaving the hot corner?

As an example of a use case, swaywm and waybar now support making the bar hidden unless the mod key is pressed. Similarly I'd like to show the bar when touching the corner, and return to hiding the bar when leaving the corner.

Reporting a vulnerability

Hello!

I hope you are doing well!

We are a security research team. Our tool automatically detected a vulnerability in this repository. We want to disclose it responsibly. GitHub has a feature called Private vulnerability reporting, which enables security research to privately disclose a vulnerability. Unfortunately, it is not enabled for this repository.

Can you enable it, so that we can report it?

Thanks in advance!

PS: you can read about how to enable private vulnerability reporting here: https://docs.github.com/en/code-security/security-advisories/repository-security-advisories/configuring-private-vulnerability-reporting-for-a-repository

Seperate command per corner/edge

How to execute a different command for each corner / edge? The following does not work:

[left]
enter_command = [ "sway-hot-edge", "left" ]

[top]
enter_command = [ "sway-hot-edge", "top" ]

[right]
enter_command = [ "sway-hot-edge", "right" ]

[bottom]
enter_command = [ "sway-hot-edge", "bottom" ]

locations = ["left", "right", "top", "bottom"]

Only the last enter_command is executed.

thx

[Feature request] Split edges -- add support for separate actions when hitting a section of an edge

Add support for separate actions when hitting a certain section of an edge. Probably best defined using a percentage/fraction of the edge. E.g from 0% to 25% etc. This would be very powerful as you could e.g go to any of your workspaces intuitively just using a single edge.

Is anyone interested/planning such an extension of edges functionality, maybe @jhpaques ? Sadly I am only beginning with coding.

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.