treewide: add filenames, fix code langs

This commit is contained in:
Mihai Fufezan 2024-11-06 22:55:14 +02:00
parent 95697479fd
commit d0c0ac1e8c
Signed by: fufexan
SSH key fingerprint: SHA256:SdnKmEpJrDu1+2UO1QpB/Eg4HKcdDi6n+xSRqFNJVpg
10 changed files with 43 additions and 66 deletions

View file

@ -215,7 +215,7 @@ exec-once = handle_monitor_connect.sh
where `handle_monitor_connect.sh` is: (example) where `handle_monitor_connect.sh` is: (example)
```sh ```sh {filename="handle_monitor_connect.sh"}
#!/bin/sh #!/bin/sh
handle() { handle() {
@ -242,9 +242,7 @@ Until then, OTD is the way to go.
### Some of my apps take a really long time to open...? ### Some of my apps take a really long time to open...?
_~/.config/hypr/hyprland.conf_ ```ini {filename="~/.config/hypr/hyprland.conf"}
```ini
exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
``` ```

View file

@ -265,7 +265,7 @@ built in CI by GitHub Actions.
You can add this repository by creating a file such as You can add this repository by creating a file such as
`/etc/xbps.d/hyprland-void.conf` with the following contents: `/etc/xbps.d/hyprland-void.conf` with the following contents:
```plain ```plain {filename="/etc/xbps.d/hyprland-void.conf"}
repository=https://raw.githubusercontent.com/Makrennel/hyprland-void/repository-x86_64-glibc repository=https://raw.githubusercontent.com/Makrennel/hyprland-void/repository-x86_64-glibc
``` ```
@ -304,7 +304,7 @@ For detailed instructions on installing this build see
Hyprland is available in Alpine's [testing repository](https://wiki.alpinelinux.org/wiki/Repositories#Testing) which can be enabled in `/etc/apk/repositories` by adding Hyprland is available in Alpine's [testing repository](https://wiki.alpinelinux.org/wiki/Repositories#Testing) which can be enabled in `/etc/apk/repositories` by adding
```plain ```plain {filename="/etc/apk/repositories"}
http://dl-cdn.alpinelinux.org/alpine/edge/testing http://dl-cdn.alpinelinux.org/alpine/edge/testing
``` ```
@ -404,7 +404,7 @@ zypper in gcc-c++ git meson cmake "pkgconfig(cairo)" "pkgconfig(egl)" "pkgconfig
{{% details title="FreeBSD" closed="true" %}} {{% details title="FreeBSD" closed="true" %}}
```plain ```sh
pkg install git pkgconf gmake gcc evdev-proto cmake wayland-protocols wayland libglvnd libxkbcommon libinput cairo pango pixman libxcb pkg install git pkgconf gmake gcc evdev-proto cmake wayland-protocols wayland libglvnd libxkbcommon libinput cairo pango pixman libxcb
pkg install meson jq hwdata libdisplay-info libliftoff pkg install meson jq hwdata libdisplay-info libliftoff
export CC=gcc CXX=g++ LDFLAGS="-static-libstdc++ -static-libgcc" export CC=gcc CXX=g++ LDFLAGS="-static-libstdc++ -static-libgcc"
@ -432,7 +432,7 @@ packaged for your distro of choice:
### CMake (recommended) ### CMake (recommended)
```Plain ```sh
git clone --recursive https://github.com/hyprwm/Hyprland git clone --recursive https://github.com/hyprwm/Hyprland
cd Hyprland cd Hyprland
make all && sudo make install make all && sudo make install
@ -443,7 +443,7 @@ installed._
### Meson ### Meson
```plain ```sh
meson subprojects update --reset meson subprojects update --reset
meson setup build meson setup build
ninja -C build ninja -C build

View file

@ -33,13 +33,13 @@ XDPH doesn't implement a file picker. For that, it is recommended to install
{{< tab "Arch Linux" >}} {{< tab "Arch Linux" >}}
```plain ```sh
pacman -S xdg-desktop-portal-hyprland pacman -S xdg-desktop-portal-hyprland
``` ```
or, for -git: or, for -git:
```plain ```sh
yay -S xdg-desktop-portal-hyprland-git yay -S xdg-desktop-portal-hyprland-git
``` ```
@ -57,9 +57,7 @@ On NixOS, XDPH is already enabled by the
## Unmask dependencies ## Unmask dependencies
### /etc/portage/profile/package.unmask ```plain {filename="/etc/portage/profile/package.unmask"}
```plain
dev-qt/qtbase dev-qt/qtbase
dev-qt/qtwayland dev-qt/qtwayland
dev-qt/qtdeclarative dev-qt/qtdeclarative
@ -68,9 +66,7 @@ dev-qt/qtshadertools
## Apply necessary useflags ## Apply necessary useflags
### /etc/portage/package.use ```plain {filename="/etc/portage/package.use"}
```plain
dev-qt/qtbase opengl egl eglfs gles2-only dev-qt/qtbase opengl egl eglfs gles2-only
dev-qt/qtdeclarative opengl dev-qt/qtdeclarative opengl
sys-apps/xdg-desktop-portal screencast sys-apps/xdg-desktop-portal screencast
@ -78,9 +74,7 @@ sys-apps/xdg-desktop-portal screencast
## Unmask dependencies and xdph ## Unmask dependencies and xdph
### /etc/portage/package.accept_keywords ```plain {filename="/etc/portage/package.accept_keywords"}
```plain
gui-libs/xdg-desktop-portal-hyprland gui-libs/xdg-desktop-portal-hyprland
dev-qt/qtbase dev-qt/qtbase
dev-qt/qtwayland dev-qt/qtwayland
@ -152,7 +146,7 @@ default (see `/usr/share/xdg-desktop-portal/hyprland-portals.conf`). If you want
to use the KDE file picker but let XDPH handle everything else, create a file to use the KDE file picker but let XDPH handle everything else, create a file
`~/.config/xdg-desktop-portal/hyprland-portals.conf` with the following content: `~/.config/xdg-desktop-portal/hyprland-portals.conf` with the following content:
```ini ```ini {filename="~/.config/xdg-desktop-portal/hyprland-portals.conf"}
[preferred] [preferred]
default = hyprland;gtk default = hyprland;gtk
org.freedesktop.impl.portal.FileChooser = kde org.freedesktop.impl.portal.FileChooser = kde

View file

@ -22,8 +22,7 @@ using the Hyprland flake package.
{{< /callout >}} {{< /callout >}}
```nix ```nix {filename="configuration.nix"}
# configuration.nix
{ {
nix.settings = { nix.settings = {
substituters = ["https://hyprland.cachix.org"]; substituters = ["https://hyprland.cachix.org"];

View file

@ -26,7 +26,7 @@ For a list of available options, check the
{{< tab "Home Manager" >}} {{< tab "Home Manager" >}}
```nix ```nix {filename="home.nix"}
{ {
programs.kitty.enable = true; # required for the default Hyprland config programs.kitty.enable = true; # required for the default Hyprland config
wayland.windowManager.hyprland.enable = true; # enable Hyprland wayland.windowManager.hyprland.enable = true; # enable Hyprland
@ -46,9 +46,7 @@ adjustment for your setup.
Don't forget to replace `user@hostname` with your username and hostname! Don't forget to replace `user@hostname` with your username and hostname!
```nix ```nix {filename="flake.nix"}
# flake.nix
{ {
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
@ -96,9 +94,7 @@ The following snippet of code tries to show how to bring the Hyprland flake from
the flake input and use the package in the Home Manager option. Feel free to the flake input and use the package in the Home Manager option. Feel free to
make any adjustment for your setup. make any adjustment for your setup.
```nix ```nix {filename="home.nix"}
# home config
{pkgs, ...}: let {pkgs, ...}: let
flake-compat = builtins.fetchTarball "https://github.com/edolstra/flake-compat/archive/master.tar.gz"; flake-compat = builtins.fetchTarball "https://github.com/edolstra/flake-compat/archive/master.tar.gz";
@ -123,9 +119,7 @@ in {
Once the module is enabled, you can use it to declaratively configure Hyprland. Once the module is enabled, you can use it to declaratively configure Hyprland.
Here is an example config: Here is an example config:
```nix ```nix {filename="home.nix"}
# home.nix
{ {
wayland.windowManager.hyprland.settings = { wayland.windowManager.hyprland.settings = {
"$mod" = "SUPER"; "$mod" = "SUPER";
@ -154,7 +148,7 @@ Here is an example config:
Hyprland plugins can be added through the `plugins` option: Hyprland plugins can be added through the `plugins` option:
```nix ```nix {filename="home.nix"}
{ {
wayland.windowManager.hyprland.plugins = [ wayland.windowManager.hyprland.plugins = [
inputs.hyprland-plugins.packages.${pkgs.stdenv.hostPlatform.system}.hyprbars inputs.hyprland-plugins.packages.${pkgs.stdenv.hostPlatform.system}.hyprbars
@ -176,7 +170,7 @@ compatibility options that should make the themes load in all situations.
Example configuration: Example configuration:
```nix ```nix {filename="home.nix"}
{ {
home.pointerCursor = { home.pointerCursor = {
gtk.enable = true; gtk.enable = true;
@ -216,13 +210,13 @@ services. This is the most common with user-configured services such as
To fix it, add to your config: To fix it, add to your config:
```nix ```nix {filename="home.nix"}
wayland.windowManager.hyprland.systemd.variables = ["--all"]; wayland.windowManager.hyprland.systemd.variables = ["--all"];
``` ```
This setting will produce the following entry in the Hyprland config: This setting will produce the following entry in the Hyprland config:
```ini ```ini {filename="hyprland.conf"}
exec-once = dbus-update-activation-environment --systemd --all exec-once = dbus-update-activation-environment --systemd --all
``` ```

View file

@ -30,9 +30,7 @@ Make sure to check out the options of the
{{< tab "Nixpkgs" >}} {{< tab "Nixpkgs" >}}
```nix ```nix {filename="configuration.nix"}
# configuration.nix
{ {
programs.hyprland.enable = true; # enable Hyprland programs.hyprland.enable = true; # enable Hyprland
@ -62,9 +60,7 @@ have to compile Hyprland yourself.
In case you want to use the development version of Hyprland, you can add it like In case you want to use the development version of Hyprland, you can add it like
this: this:
```nix ```nix {filename="flake.nix"}
# flake.nix
{ {
inputs.hyprland.url = "github:hyprwm/Hyprland"; inputs.hyprland.url = "github:hyprwm/Hyprland";
# ... # ...
@ -78,9 +74,9 @@ this:
}; };
}; };
} }
```
# configuration.nix ```nix {filename="configuration.nix"}
{inputs, pkgs, ...}: { {inputs, pkgs, ...}: {
programs.hyprland = { programs.hyprland = {
enable = true; enable = true;
@ -100,7 +96,7 @@ version mismatch between your system and Hyprland.
You can fix this issue by using `mesa` from Hyprland's `nixpkgs` input: You can fix this issue by using `mesa` from Hyprland's `nixpkgs` input:
```nix ```nix {filename="configuration.nix"}
{pkgs, inputs, ...}: let {pkgs, inputs, ...}: let
pkgs-unstable = inputs.hyprland.inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system}; pkgs-unstable = inputs.hyprland.inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system};
in { in {
@ -128,9 +124,7 @@ have to compile Hyprland yourself.
{{< /callout >}} {{< /callout >}}
```nix ```nix {filename="configuration.nix"}
# configuration.nix
{pkgs, ...}: let {pkgs, ...}: let
flake-compat = builtins.fetchTarball "https://github.com/edolstra/flake-compat/archive/master.tar.gz"; flake-compat = builtins.fetchTarball "https://github.com/edolstra/flake-compat/archive/master.tar.gz";
@ -160,7 +154,7 @@ relevant section in [Hyprland on Home Manager](../Hyprland-on-Home-Manager).
If you prefer not to use Home Manager, you can also resolve the issues with GTK If you prefer not to use Home Manager, you can also resolve the issues with GTK
themes using dconf like so: themes using dconf like so:
```ini ```ini {filename="hyprland.conf"}
exec-once = dconf write /org/gnome/desktop/interface/gtk-theme "'Adwaita'" exec-once = dconf write /org/gnome/desktop/interface/gtk-theme "'Adwaita'"
exec-once = dconf write /org/gnome/desktop/interface/icon-theme "'Flat-Remix-Red-Dark'" exec-once = dconf write /org/gnome/desktop/interface/icon-theme "'Flat-Remix-Red-Dark'"
exec-once = dconf write /org/gnome/desktop/interface/document-font-name "'Noto Sans Medium 11'" exec-once = dconf write /org/gnome/desktop/interface/document-font-name "'Noto Sans Medium 11'"

View file

@ -18,7 +18,7 @@ the [Home Manager module](../Hyprland-on-Home-Manager).
In Nixpkgs, there are Hyprland plugins packaged for the Hyprland version in In Nixpkgs, there are Hyprland plugins packaged for the Hyprland version in
Nixpkgs. You can use them like this: Nixpkgs. You can use them like this:
```nix ```nix {filename="home.nix"}
{pkgs, ...}: { {pkgs, ...}: {
wayland.windowManager.hyprland.plugins = [ wayland.windowManager.hyprland.plugins = [
pkgs.hyprlandPlugins.<plugin> pkgs.hyprlandPlugins.<plugin>
@ -38,7 +38,7 @@ flake, and **not** the Nixpkgs version.
First, add the flake to your flake inputs: First, add the flake to your flake inputs:
```nix ```nix {filename="flake.nix"}
{ {
inputs = { inputs = {
hyprland.url = "github:hyprwm/Hyprland"; hyprland.url = "github:hyprwm/Hyprland";
@ -59,7 +59,7 @@ long as you update both inputs at once.
The next step is adding the plugins to Hyprland: The next step is adding the plugins to Hyprland:
```nix ```nix {filename="home.nix"}
{inputs, pkgs, ...}: { {inputs, pkgs, ...}: {
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
enable = true; enable = true;

View file

@ -22,7 +22,7 @@ To install Hyprland on NixOS, we provide a NixOS and a Home Manager module.
## NixOS module ## NixOS module
```nix ```nix {filename="configuration.nix"}
{ {
programs.hyprland.enable = true; programs.hyprland.enable = true;
# Optional, hint electron apps to use wayland: # Optional, hint electron apps to use wayland:

View file

@ -60,13 +60,13 @@ driver modules need to be added to the initramfs.
Edit `/etc/mkinitcpio.conf`. In the `MODULES` array, add the following module names: Edit `/etc/mkinitcpio.conf`. In the `MODULES` array, add the following module names:
```ini ```conf {filename="/etc/mkinitcpio.conf"}
MODULES=(... nvidia nvidia_modeset nvidia_uvm nvidia_drm ...) MODULES=(... nvidia nvidia_modeset nvidia_uvm nvidia_drm ...)
``` ```
Then, create and edit `/etc/modprobe.d/nvidia.conf`. Add this line to the file: Then, create and edit `/etc/modprobe.d/nvidia.conf`. Add this line to the file:
```ini ```conf {filename="/etc/modprobe.d/nvidia.conf"}
options nvidia_drm modeset=1 fbdev=1 options nvidia_drm modeset=1 fbdev=1
``` ```
@ -78,7 +78,7 @@ More information is available [here](https://wiki.archlinux.org/title/NVIDIA#DRM
Add these variables to your Hyprland config: Add these variables to your Hyprland config:
```sh ```ini
env = LIBVA_DRIVER_NAME,nvidia env = LIBVA_DRIVER_NAME,nvidia
env = XDG_SESSION_TYPE,wayland env = XDG_SESSION_TYPE,wayland
env = GBM_BACKEND,nvidia-drm env = GBM_BACKEND,nvidia-drm
@ -130,7 +130,7 @@ be given here:
repos. repos.
2. Add this variable to your hyprland config: 2. Add this variable to your hyprland config:
```sh ```ini
env = NVD_BACKEND,direct env = NVD_BACKEND,direct
``` ```
@ -166,7 +166,7 @@ To fix the flickering, try running the apps in native Wayland instead.
For most Electron apps, you should be fine just adding this For most Electron apps, you should be fine just adding this
environment variable to your config: environment variable to your config:
```sh ```ini
env = ELECTRON_OZONE_PLATFORM_HINT,auto env = ELECTRON_OZONE_PLATFORM_HINT,auto
``` ```
@ -184,7 +184,7 @@ in their official repos. You should use that instead of the `spotify`
package in the AUR. Then, enable the Wayland backend in package in the AUR. Then, enable the Wayland backend in
`/etc/spotify-launcher.conf` by uncommenting this line: `/etc/spotify-launcher.conf` by uncommenting this line:
```sh ```sh {filename="/etc/spotify-launcher.conf"}
extra_arguments = ["--enable-features=UseOzonePlatform", "--ozone-platform=wayland"] extra_arguments = ["--enable-features=UseOzonePlatform", "--ozone-platform=wayland"]
``` ```
@ -236,7 +236,7 @@ do notice flickering artifacts from being idle for ~5 seconds.
Make a new file at `/etc/modprobe.d/nvidia.conf` and paste this in: Make a new file at `/etc/modprobe.d/nvidia.conf` and paste this in:
```sh ```conf {filename="/etc/modprobe.d/nvidia.conf"}
options nvidia NVreg_RegistryDwords="PowerMizerEnable=0x1; PerfLevelSrc=0x2222; PowerMizerLevel=0x3; PowerMizerDefault=0x3; PowerMizerDefaultAC=0x3" options nvidia NVreg_RegistryDwords="PowerMizerEnable=0x1; PerfLevelSrc=0x2222; PowerMizerLevel=0x3; PowerMizerDefault=0x3; PowerMizerDefaultAC=0x3"
``` ```
@ -267,9 +267,7 @@ make sure you're on `nvidia-dkms`.
For Nix users, the equivalent of the above is For Nix users, the equivalent of the above is
```nix ```nix {filename="configuration.nix"}
# configuration.nix
boot.kernelParams = [ "nvidia.NVreg_PreserveVideoMemoryAllocations=1" ]; boot.kernelParams = [ "nvidia.NVreg_PreserveVideoMemoryAllocations=1" ];
hardware.nvidia.powerManagement.enable = true; hardware.nvidia.powerManagement.enable = true;

View file

@ -19,7 +19,7 @@ Make a file in the root of your repository called `hyprpm.toml`.
At the beginning, put some metadata about your plugin: At the beginning, put some metadata about your plugin:
```toml ```toml {filename="hyprpm.toml"}
[repository] [repository]
name = "MyPlugin" name = "MyPlugin"
authors = ["Me"] authors = ["Me"]
@ -36,7 +36,7 @@ commit_pins = [
For each plugin, make a category like this: For each plugin, make a category like this:
```toml ```toml {filename="hyprpm.toml"}
[plugin-name] [plugin-name]
description = "An epic plugin that will change the world!" description = "An epic plugin that will change the world!"
authors = ["Me"] authors = ["Me"]