IPC, Nix, Nvidia fixes

This commit is contained in:
Mihai Fufezan 2022-08-13 20:06:18 +03:00
parent 5e20cb924f
commit 047d91b6aa
No known key found for this signature in database
GPG Key ID: 5899325F2F120900
3 changed files with 42 additions and 32 deletions

View File

@ -3,14 +3,14 @@ via code / bash utilities.
## Hyprland Instance Signature (HIS)
```
```sh
echo $HYPRLAND_INSTANCE_SIGNATURE
```
# /tmp/hypr/\[HIS\]/.socket.sock
Used for hyprctl-like requests. See the
[Hyprctl page](https://github.com/hyprwm/Hyprland/wiki/Using-hyprctl) for
[Hyprctl page](../Configuring/Using-hyprctl) for
commands.
basically, write `command args`.
@ -31,19 +31,19 @@ e.g.: `workspace>>2`
emitted on workspace change. Is emitted ONLY when a user requests a workspace
change, and is not emitted on mouse movements (see `activemon`)
Data: WORKSPACENAME
Data: `WORKSPACENAME`
### focusedmon
emitted on the active monitor being changed.
Data: MONNAME,WORKSPACENAME
Data: `MONNAME,WORKSPACENAME`
### activewindow
emitted on the active window being changed.
Data: WINDOWCLASS,WINDOWTITLE
Data: `WINDOWCLASS,WINDOWTITLE`
### fullscreen
@ -53,31 +53,31 @@ Warning: a fullscreen event is not guaranteed to fire on/off once in succession.
A window might do for example 3 requests to be fullscreen'd, which would result
in 3 fullscreen events.
Data: 0/1 (exit fullscreen / enter fullscreen)
Data: `0/1` (exit fullscreen / enter fullscreen)
### monitorremoved
emitted when a monitor is removed (disconnected)
Data: MONITORNAME
Data: `MONITORNAME`
### monitoradded
emitted when a monitor is added (connected)
Data: MONITORNAME
Data: `MONITORNAME`
### createworkspace and destroyworkspace
emitted when a workspace is created or removed
Data: WORKSPANCENAME
Data: `WORKSPANCENAME`
## How to use socket2 with bash
example script using socket2 events with bash and `socat`:
```
```sh
#!/bin/sh
function handle {

View File

@ -1,7 +1,11 @@
**NOTE:** Hyprland is NOT supported on NixOS stable. It may (not) compile or
work as intended. Please use the flake.
## Table of contents
{{< toc format=html >}}
## Install and configure Hyprland on Nix & NixOS
**NOTE:** Hyprland is NOT supported on NixOS stable. It may (not) compile or
work as intended. Please use the
[flake](https://github.com/hyprwm/Hyprland/blob/main/flake.nix).
## Install and configure Hyprland on NixOS
Make sure to check out the options of the
[Nix module](https://github.com/hyprwm/Hyprland/blob/main/nix/module.nix).
@ -36,8 +40,10 @@ Don't forget to replace `HOSTNAME` with your hostname!
### Without flakes
**NOTE:** If you're using Hyprland through an overlay, set
{{< hint >}}
If you're using Hyprland through an overlay, set
`programs.hyprland.package = pkgs.hyprland;`.
{{< /hint >}}
```nix
# configuration.nix
@ -50,17 +56,15 @@ in {
imports = [
hyprland.nixosModules.default
];
nixpkgs.overlays = [ hyprland.overlays.default ];
programs.hyprland = {
enable = true;
package = pkgs.hyprland;
package = hyprland.packages.${pkgs.system}.default;
};
}
```
## Home Manager module
## Install and configure through Home Manager
You can use the Home Manager module by adding it to your configuration:
@ -80,22 +84,27 @@ For a list of available options, check the
## Modules mix'n'match
If you plan on using the HM module alongside the NixOS module, set the NixOS
- If you plan on using the HM module alongside the NixOS module, set the NixOS
`programs.hyprland.package = null;`.
If you don't plan on using the NixOS module, but want to use the HM module, you
- If you don't plan on using the NixOS module, but want to use the HM module, you
will have to enable all the options the NixOS module enables.
If you don't plan on using any module, manually enable whatever options the
- If you don't plan on using any module, manually enable whatever options the
modules set.
## Non-NixOS install
If you plan on using Hyprland through Nix, outside of NixOS, please use
[nixGL](https://github.com/guibou/nixGL).
## Cachix
A [Hyprland Cachix](https://app.cachix.org/cache/nix-gaming) exists to cache the
A [Hyprland Cachix](https://app.cachix.org/cache/hyprland) exists to cache the
`wlroots` package and speed up builds.
In case you don't plan on changing the Nixpkgs Hyprland builds with, you can use
this cache to speed up your builds.
In case you don't plan on changing the Nixpkgs input of Hyprland, you can use
this cache to download the binary directly, instead of building locally.
```nix
# configuration.nix

View File

@ -10,15 +10,16 @@ Nevertheless, it's recommended to at least try this tutorial.
## How to get Hyprland to possibly work on Nvidia
Install the `nvidia-dkms` driver and add it to your initram & kernel parameters,
follow the information available here:
Install the `nvidia-dkms` driver and add it to your initramfs & kernel
parameters. Follow the information available here:
[https://wiki.archlinux.org/title/NVIDIA#DRM_kernel_mode_setting](https://wiki.archlinux.org/title/NVIDIA#DRM_kernel_mode_setting)
_\* Note_: If your GPU is listed as supported by the `nvidia-open-dkms` driver,
go with that one instead.
{{< hint >}}If your GPU is listed as supported by the `nvidia-open-dkms` driver,
use that one instead.
{{< /hint >}}
Following the wrapping instructions found at
[The Quick Start Page](https://github.com/hyprwm/Hyprland/wiki/Quick-start#wrapping-the-launcher-recommended),
Following the wrapping instructions found on
[the Quick Start page](../Getting-Started/Quick-start#wrapping-the-launcher-recommended),
wrap the launcher and additionally export these:
```sh
@ -55,7 +56,7 @@ in-fact do notice flickering artifacts from being idle for ~5 seconds.
Make a new file at `/etc/modprobe.d/nvidia.conf` and paste this in:
```
```sh
options nvidia NVreg_RegistryDwords="PowerMizerEnable=0x1; PerfLevelSrc=0x2222; PowerMizerLevel=0x3; PowerMizerDefault=0x3; PowerMizerDefaultAC=0x3"
```