From d0c0ac1e8cd7202e159305952f340980b6b8734b Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Wed, 6 Nov 2024 22:55:14 +0200 Subject: [PATCH] treewide: add filenames, fix code langs --- pages/FAQ/_index.md | 6 ++--- pages/Getting Started/Installation.md | 10 ++++----- .../xdg-desktop-portal-hyprland.md | 18 +++++---------- pages/Nix/Cachix.md | 3 +-- pages/Nix/Hyprland on Home Manager.md | 22 +++++++------------ pages/Nix/Hyprland on NixOS.md | 20 ++++++----------- pages/Nix/Plugins.md | 6 ++--- pages/Nix/_index.md | 2 +- pages/Nvidia/_index.md | 18 +++++++-------- .../Plugins/Development/Plugin-Guidelines.md | 4 ++-- 10 files changed, 43 insertions(+), 66 deletions(-) diff --git a/pages/FAQ/_index.md b/pages/FAQ/_index.md index eab2f10..fe9b5b9 100644 --- a/pages/FAQ/_index.md +++ b/pages/FAQ/_index.md @@ -215,7 +215,7 @@ exec-once = handle_monitor_connect.sh where `handle_monitor_connect.sh` is: (example) -```sh +```sh {filename="handle_monitor_connect.sh"} #!/bin/sh handle() { @@ -242,9 +242,7 @@ Until then, OTD is the way to go. ### Some of my apps take a really long time to open...? -_~/.config/hypr/hyprland.conf_ - -```ini +```ini {filename="~/.config/hypr/hyprland.conf"} exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP ``` diff --git a/pages/Getting Started/Installation.md b/pages/Getting Started/Installation.md index e816d96..6523e02 100644 --- a/pages/Getting Started/Installation.md +++ b/pages/Getting Started/Installation.md @@ -265,7 +265,7 @@ built in CI by GitHub Actions. You can add this repository by creating a file such as `/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 ``` @@ -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 -```plain +```plain {filename="/etc/apk/repositories"} 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" %}} -```plain +```sh 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 export CC=gcc CXX=g++ LDFLAGS="-static-libstdc++ -static-libgcc" @@ -432,7 +432,7 @@ packaged for your distro of choice: ### CMake (recommended) -```Plain +```sh git clone --recursive https://github.com/hyprwm/Hyprland cd Hyprland make all && sudo make install @@ -443,7 +443,7 @@ installed._ ### Meson -```plain +```sh meson subprojects update --reset meson setup build ninja -C build diff --git a/pages/Hypr Ecosystem/xdg-desktop-portal-hyprland.md b/pages/Hypr Ecosystem/xdg-desktop-portal-hyprland.md index 521eca1..29f4479 100644 --- a/pages/Hypr Ecosystem/xdg-desktop-portal-hyprland.md +++ b/pages/Hypr Ecosystem/xdg-desktop-portal-hyprland.md @@ -33,13 +33,13 @@ XDPH doesn't implement a file picker. For that, it is recommended to install {{< tab "Arch Linux" >}} -```plain +```sh pacman -S xdg-desktop-portal-hyprland ``` or, for -git: -```plain +```sh yay -S xdg-desktop-portal-hyprland-git ``` @@ -57,9 +57,7 @@ On NixOS, XDPH is already enabled by the ## Unmask dependencies -### /etc/portage/profile/package.unmask - -```plain +```plain {filename="/etc/portage/profile/package.unmask"} dev-qt/qtbase dev-qt/qtwayland dev-qt/qtdeclarative @@ -68,9 +66,7 @@ dev-qt/qtshadertools ## Apply necessary useflags -### /etc/portage/package.use - -```plain +```plain {filename="/etc/portage/package.use"} dev-qt/qtbase opengl egl eglfs gles2-only dev-qt/qtdeclarative opengl sys-apps/xdg-desktop-portal screencast @@ -78,9 +74,7 @@ sys-apps/xdg-desktop-portal screencast ## Unmask dependencies and xdph -### /etc/portage/package.accept_keywords - -```plain +```plain {filename="/etc/portage/package.accept_keywords"} gui-libs/xdg-desktop-portal-hyprland dev-qt/qtbase 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 `~/.config/xdg-desktop-portal/hyprland-portals.conf` with the following content: -```ini +```ini {filename="~/.config/xdg-desktop-portal/hyprland-portals.conf"} [preferred] default = hyprland;gtk org.freedesktop.impl.portal.FileChooser = kde diff --git a/pages/Nix/Cachix.md b/pages/Nix/Cachix.md index 2ad18f7..86dc0e9 100644 --- a/pages/Nix/Cachix.md +++ b/pages/Nix/Cachix.md @@ -22,8 +22,7 @@ using the Hyprland flake package. {{< /callout >}} -```nix -# configuration.nix +```nix {filename="configuration.nix"} { nix.settings = { substituters = ["https://hyprland.cachix.org"]; diff --git a/pages/Nix/Hyprland on Home Manager.md b/pages/Nix/Hyprland on Home Manager.md index c3895e5..0f4c0e5 100644 --- a/pages/Nix/Hyprland on Home Manager.md +++ b/pages/Nix/Hyprland on Home Manager.md @@ -26,7 +26,7 @@ For a list of available options, check the {{< tab "Home Manager" >}} -```nix +```nix {filename="home.nix"} { programs.kitty.enable = true; # required for the default Hyprland config 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! -```nix -# flake.nix - +```nix {filename="flake.nix"} { inputs = { 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 make any adjustment for your setup. -```nix -# home config - +```nix {filename="home.nix"} {pkgs, ...}: let 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. Here is an example config: -```nix -# home.nix - +```nix {filename="home.nix"} { wayland.windowManager.hyprland.settings = { "$mod" = "SUPER"; @@ -154,7 +148,7 @@ Here is an example config: Hyprland plugins can be added through the `plugins` option: -```nix +```nix {filename="home.nix"} { wayland.windowManager.hyprland.plugins = [ 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: -```nix +```nix {filename="home.nix"} { home.pointerCursor = { 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: -```nix +```nix {filename="home.nix"} wayland.windowManager.hyprland.systemd.variables = ["--all"]; ``` This setting will produce the following entry in the Hyprland config: -```ini +```ini {filename="hyprland.conf"} exec-once = dbus-update-activation-environment --systemd --all ``` diff --git a/pages/Nix/Hyprland on NixOS.md b/pages/Nix/Hyprland on NixOS.md index b2caead..b625d67 100644 --- a/pages/Nix/Hyprland on NixOS.md +++ b/pages/Nix/Hyprland on NixOS.md @@ -30,9 +30,7 @@ Make sure to check out the options of the {{< tab "Nixpkgs" >}} -```nix -# configuration.nix - +```nix {filename="configuration.nix"} { 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 this: -```nix -# flake.nix - +```nix {filename="flake.nix"} { inputs.hyprland.url = "github:hyprwm/Hyprland"; # ... @@ -78,9 +74,9 @@ this: }; }; } +``` -# configuration.nix - +```nix {filename="configuration.nix"} {inputs, pkgs, ...}: { programs.hyprland = { 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: -```nix +```nix {filename="configuration.nix"} {pkgs, inputs, ...}: let pkgs-unstable = inputs.hyprland.inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system}; in { @@ -128,9 +124,7 @@ have to compile Hyprland yourself. {{< /callout >}} -```nix -# configuration.nix - +```nix {filename="configuration.nix"} {pkgs, ...}: let 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 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/icon-theme "'Flat-Remix-Red-Dark'" exec-once = dconf write /org/gnome/desktop/interface/document-font-name "'Noto Sans Medium 11'" diff --git a/pages/Nix/Plugins.md b/pages/Nix/Plugins.md index 961eb92..7f46b2b 100644 --- a/pages/Nix/Plugins.md +++ b/pages/Nix/Plugins.md @@ -18,7 +18,7 @@ the [Home Manager module](../Hyprland-on-Home-Manager). In Nixpkgs, there are Hyprland plugins packaged for the Hyprland version in Nixpkgs. You can use them like this: -```nix +```nix {filename="home.nix"} {pkgs, ...}: { wayland.windowManager.hyprland.plugins = [ pkgs.hyprlandPlugins. @@ -38,7 +38,7 @@ flake, and **not** the Nixpkgs version. First, add the flake to your flake inputs: -```nix +```nix {filename="flake.nix"} { inputs = { 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: -```nix +```nix {filename="home.nix"} {inputs, pkgs, ...}: { wayland.windowManager.hyprland = { enable = true; diff --git a/pages/Nix/_index.md b/pages/Nix/_index.md index 14a48f2..251edb9 100644 --- a/pages/Nix/_index.md +++ b/pages/Nix/_index.md @@ -22,7 +22,7 @@ To install Hyprland on NixOS, we provide a NixOS and a Home Manager module. ## NixOS module -```nix +```nix {filename="configuration.nix"} { programs.hyprland.enable = true; # Optional, hint electron apps to use wayland: diff --git a/pages/Nvidia/_index.md b/pages/Nvidia/_index.md index b6b6576..e8b6c21 100644 --- a/pages/Nvidia/_index.md +++ b/pages/Nvidia/_index.md @@ -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: -```ini +```conf {filename="/etc/mkinitcpio.conf"} MODULES=(... nvidia nvidia_modeset nvidia_uvm nvidia_drm ...) ``` 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 ``` @@ -78,7 +78,7 @@ More information is available [here](https://wiki.archlinux.org/title/NVIDIA#DRM Add these variables to your Hyprland config: -```sh +```ini env = LIBVA_DRIVER_NAME,nvidia env = XDG_SESSION_TYPE,wayland env = GBM_BACKEND,nvidia-drm @@ -130,7 +130,7 @@ be given here: repos. 2. Add this variable to your hyprland config: - ```sh + ```ini 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 environment variable to your config: -```sh +```ini 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 `/etc/spotify-launcher.conf` by uncommenting this line: -```sh +```sh {filename="/etc/spotify-launcher.conf"} 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: -```sh +```conf {filename="/etc/modprobe.d/nvidia.conf"} 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 -```nix -# configuration.nix - +```nix {filename="configuration.nix"} boot.kernelParams = [ "nvidia.NVreg_PreserveVideoMemoryAllocations=1" ]; hardware.nvidia.powerManagement.enable = true; diff --git a/pages/Plugins/Development/Plugin-Guidelines.md b/pages/Plugins/Development/Plugin-Guidelines.md index bf74b9c..2518b3e 100644 --- a/pages/Plugins/Development/Plugin-Guidelines.md +++ b/pages/Plugins/Development/Plugin-Guidelines.md @@ -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: -```toml +```toml {filename="hyprpm.toml"} [repository] name = "MyPlugin" authors = ["Me"] @@ -36,7 +36,7 @@ commit_pins = [ For each plugin, make a category like this: -```toml +```toml {filename="hyprpm.toml"} [plugin-name] description = "An epic plugin that will change the world!" authors = ["Me"]