Git Product home page Git Product logo

hyprland-notify-dismiss's Introduction

Hyprland notify-dismiss plugin

This is a simple plugin that adds support for sending notifydismiss requests via the hyprctl socket (.socket.sock, not .socket2.sock).

Warning

The support for this feature was introduced into Hyprland in hyprwm/Hyprland#4790 making this plugin pointless. (Note that in the official version, the hyprctl command is dismissnotify, not notifydismiss)

If you need support for the feature, you simply build Hyprland from the latest master (or at least from commit be89d6f).

If you don't want to build Hyprland yourself, and instead prefer to use the stable releases, you can keep using this plugin until the next release comes out. However once that happens, I will archive or even delete this repository.

Usage

Netcat (writing the command directly to socket)

You can either send the notifydismiss request directly to the .socket.sock:

echo "notifydismiss" | nc -U "/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket.sock"

Which will dismiss all notifications, or you can use:

echo "notifydismiss 2" | nc -U "/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket.sock"

Which will dismiss the 2 oldest notifications. (Passing -1 will also dismiss all notifications.)

Hyprctl

Due to the limitations on how Hyprland plugins work, it is not possible to hook into hyprctl binary and change the inner handling there, hooks only work within the Hyprland binary.

That said, since hyprctl already has support for notify command, the way it's implemented will allow you to also use it with any other command, that also starts with notify, so calling hyprctl notifydismiss will actually work.

That said, hyprctl will expect a minimum of 2 arguments here, since that's the setting for notify. This isn't an issue though, as the 2nd argument will simply be ignored, so you can pass it anything, it just must be there.

Example usage:

hyprctl notifydismiss -1 foo  # dismiss all notifications
hyprctl notifydismiss 2 bar  # dissmiss 2 oldest notifications

Installation

The recommended way to install this plugin is via the official plugin manager hyprpm:

  • hyprpm add https://github.com/ItsDrike/hyprland-notify-dismiss
  • hyprpm enable notify-dismiss

To automatically load the plugin when Hyprland starts, add exec-once = hyprpm reload -n to your Hyprland config.

Alternatively, you can also install manually:

  • make all
  • hyprctl plugin load ${PWD}/notify-dismiss.so (must be an absolute path)

hyprland-notify-dismiss's People

Contributors

itsdrike avatar

Watchers

 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.