Skip to content

Window minimization plugin for hyprland,Enhancements to special workspaces

License

Notifications You must be signed in to change notification settings

DreamMaoMao/hych

Repository files navigation

Note

Sorry guys. Since I don't use this warehouse much and it is not needed by many others, I decided that this warehouse will no longer track the latest hyprland

hych

Window minimization plugin for hyprland,Enhancements to special workspaces.

what can it do:

  • Support remember the workspace which the window was in

  • Support restore minimize window by 'alt-tab' mode like switch window in "gnome alt-tab"

  • Support minimize window and restore window by clicking the icon on the waybar

  • Support customize the minimization status on the waybar

  • Support for minimize buttons in app

  • Support use shortcut keys to Ergodic restore in the normal Workspace(without select)

This plugin uses the special workspace built into hyprland to hide windows, aiming to enhance the functionality of the special workspace, so it can also be compatible with the previous special workspace operations.

For example, you can restore the windows that you put into the special workspace by the old way by clicking the waybar icon or using the shortcut keys of this plugin to the normal workspace.

by click waybar icon or app minimize button

2024-01-21.11-06-00.mp4

alt-tab select mode

2024-01-21.11-07-23.mp4

no select mode

2024-01-21.11-06-49.mp4

Manual Installation

something need to notice

1.You need to manually relogin after it is installed. after the installation is complete, it may also trigger logout if you do not logout which is normal.

2.Only supports hyprland source code after 2024-1-25. because the plugin requires this commit in hyprland

using cmake:
git clone https://github.com/DreamMaoMao/hych.git
cd hych
bash install.sh # `libhych.so` path: /usr/lib/libhych.so

Usage (hyprland.conf)

plugin = /usr/lib/libhych.so

bind=ALT,i,hych:minimize # minimize window
bind=ALT_SHIFT,i,hych:restore_minimize #manual restore window
bind = ALT, w, hych:toggle_restore_window # enter special or restore windwo(normal mode),enter special or switch focus(alt-tab mode)

plugin {
    hych {
        enable_alt_release_exit = 1 # alt swith mode,see readme for detail
        alt_replace_key = code:64 # alt swith mode,see readme for detail
    }
}

NixOS with home—manager

Note: Requires home-manager after this commit

# flake.nix

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

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

    hyprland.url = "github:hyprwm/Hyprland";

    hych = {
      url = "github:DreamMaoMao/hych";
      inputs.hyprland.follows = "hyprland";
    };
  };

  outputs = { nixpkgs, home-manager, hyprland, hych, ... }:
    let
      system = "x86_64-linux";
      pkgs = nixpkgs.legacyPackages.${system};
    in
    {
      homeConfigurations."user@hostname" = home-manager.lib.homeManagerConfiguration {
        pkgs = nixpkgs.legacyPackages.x86_64-linux;

        modules = [
          hyprland.homeManagerModules.default
          {
            wayland.windowManager.hyprland = {
              enable = true;
              plugins = [
                hych.packages.${pkgs.system}.hych
              ];

              settings = {
                bind = [
                  "ALT,i,hych:minimize"
                  "ALT_SHIFT,i,hych:restore_minimize"
                  "ALT, w, hych:toggle_restore_window"
                ];

                plugin.hych = {
                  enable_alt_release_exit = 1;
                  alt_replace_key = code:64;
                };
              };
            };
          }
        ];
      };
    };
}

click waybar icon

  • when the window is not active, clicking the waybar icon button will activate the window
  • when the window is active, clicking the icon button will minimize the window
  • when the window has been minimized, clicking the icon button will restore the window

alt-tab mode

such as bind to alt + w:

  • 1.alt + w will enter special workspace when you not in special workspace(please hold alt,don't make it release)

  • 2.alt + w will switch window focus circularly when you in special workspace. (please hold alt,don't make it release)

  • 3.when you release alt , it will auto exit special workspace and restore the select window.

If you don't want to use `alt` as MainKey in alt mode

such as use super to repalce alt

  • 1.bind toggleoverview
bind = SUPER,w,hych:toggle_restore_window
  • 2.use alt_replace_key to specify what is the detection key on release.
# use keyname
alt_replace_key = Super_L # Alt_L,Alt_R,Super_L,Super_R,Control_L,Control_R,Shift_L,Shift_R

# use keycode
alt_replace_key = code:133 # use `xev` command to get keycode

waybar config demo

module config
"wlr/taskbar": {
    "format": "{icon}",
    "icon-size": 30,
    "all-outputs": false,
    "tooltip-format": "{title}",
    "on-click": "activate",
    "on-click-right": "close"
  },
css style
#taskbar{
    background-color: transparent;
    margin-top: 10px;
    margin-bottom: 10px;
    margin-right: 8px;
    margin-left: 8px;
}

#taskbar button{
    box-shadow: rgba(0, 0, 0, 0.5) 0 -3 5 5px;
    /* text-shadow: 0 0 2px rgba(0, 0, 0, 0.8); */
    background-color: rgb(237, 196, 147);
    margin-right: 8px;
    padding-top: 4px;
    padding-bottom: 2px;
    padding-right: 10px;
    padding-left: 10px;
    font-weight: bolder;
    color: 	#ededed ;
    border: none;
    border-bottom: 6px solid rgb(193, 146, 103);
    border-radius: 15px;
}

#taskbar button.minimized{
    box-shadow: rgba(0, 0, 0, 0.5) 0 -3 5 5px;
    background-color: rgb(146, 140, 151);
    margin-right: 8px;
    padding-top: 4px;
    padding-bottom: 2px;
    padding-right: 10px;
    padding-left: 10px;
    font-weight: bolder;
    color: 	#cba6f7 ;
    border: none;
    border-bottom: 6px solid rgb(98, 97, 99);
    border-radius: 15px;
}

#taskbar button.urgent{
    box-shadow: rgba(0, 0, 0, 0.5) 0 -3 5 5px;
    background-color: rgb(238, 92, 92);
    margin-right: 8px;
    padding-top: 4px;
    padding-bottom: 2px;
    padding-right: 10px;
    padding-left: 10px;
    font-weight: bolder;
    color: 	#cba6f7 ;
    border: none;
    border-bottom: 6px solid rgb(183, 63, 63);
    border-radius: 15px;
}

#taskbar button.active{
    box-shadow: rgba(0, 0, 0, 0.5) 0 -3 5 5px;
    background-color: rgb(186, 238, 225);
    margin-right: 8px;
    padding-top: 4px;
    padding-bottom: 2px;
    padding-right: 10px;
    padding-left: 10px;
    font-weight: bolder;
    color: 	#cba6f7 ;
    border: none;
    border-bottom: 6px solid rgb(131, 184, 171);
    border-radius: 15px;
}

Frequently Asked Questions

  • some config not work, or the plugin not work.
if you use install hych at first time,please try logout and relogin again.
  • Compilation failure
Please pull the latest hyprland source code to compile and install. The plugin relies on a hyprland pr,pr submission date (2023-10-21)
  • Unable to load
Check whether hyprland has been updated, and if so, please recompile hyprcov

About

Window minimization plugin for hyprland,Enhancements to special workspaces

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published