From 159ce3c1c2dab66af4ba175f7e77250cdcec8c93 Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Thu, 10 Oct 2024 16:29:14 +0200 Subject: [PATCH] Update --- .github/workflows/update-readme.yml | 24 ++++++++ docs/KEYBINDINGS-HYPRLAND.md | 75 +++++++++++++------------ docs/scripts/keybindings_to_markdown.sh | 11 ++-- docs/src/README_template.md | 15 ++--- hosts/laptop/configuration.nix | 5 +- hosts/laptop/home.nix | 2 +- hosts/laptop/secrets/default.nix | 2 + hosts/laptop/variables.nix | 3 +- nixos/prime.nix | 8 ++- 9 files changed, 90 insertions(+), 55 deletions(-) create mode 100644 .github/workflows/update-readme.yml diff --git a/.github/workflows/update-readme.yml b/.github/workflows/update-readme.yml new file mode 100644 index 0000000..9385905 --- /dev/null +++ b/.github/workflows/update-readme.yml @@ -0,0 +1,24 @@ +on: + push: + paths: + - 'docs/src/README_template.md' +permissions: + contents: write +jobs: + update-readme: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./ + steps: + - name: Check out the repository to the runner + uses: actions/checkout@v4 + - name: Run a script + run: | + chmod +x ./docs/scripts/create_readme.sh + ./docs/scripts/create_readme.sh + git config user.name github-actions + git config user.email github-actions@github.com + git add . + git commit -m "Update README.md (auto)" + git push diff --git a/docs/KEYBINDINGS-HYPRLAND.md b/docs/KEYBINDINGS-HYPRLAND.md index 0b141b1..3b64951 100644 --- a/docs/KEYBINDINGS-HYPRLAND.md +++ b/docs/KEYBINDINGS-HYPRLAND.md @@ -1,45 +1,46 @@ [//]: # (This file is autogenerated) # Keybindings for Hyprland -The list of the keybindings working on Hyprland: +> [!NOTE] +> SUPER is the windows key by default | Description | Keybinding | | -- | -- | | Switch Workspace | SUPER + {Number} | | Move app to Workspace | SHIFT + SUPER + {Number} | -| Kitty | SUPER + RETURN | -| Thunar | SUPER + E | -| Qutebrowser | SUPER + B | -| Bitwarden | SUPER + K | -| Lock | SUPER + L | -| Powermenu | SUPER + X | -| Launcher | SUPER + SPACE | -| Toggle HyprFocus | SHIFT + SUPER + SPACE | -| Close window | SUPER + Q | -| Toggle Floating | SUPER + T | -| Toggle Fullscreen | SUPER + F | -| Move focus left | SUPER + left | -| Move focus Right | SUPER + right | -| Move focus Up | SUPER + up | -| Move focus Down | SUPER + down | -| Focus previous monitor | SHIFT + SUPER + up | -| Focus next monitor | SHIFT + SUPER + down | -| Add to master | SHIFT + SUPER + left | -| Remove from master | SHIFT + SUPER + right | -| Screenshot window | SUPER + PRINT | -| Screenshot monitor | PRINT | -| Screenshot region | SHIFT + SUPER + PRINT | -| Screenshot region then edit | ALT PRINT | -| Search on internet with wofi | SHIFT + SUPER + S | -| Clipboard picker with wofi | SHIFT + SUPER + C | -| Emoji picker with wofi | SHIFT + SUPER + E | -| Toggle night shift | SUPER + F2 | -| Toggle night shift | SUPER + F3 | -| Move Window (mouse) | SUPER + mouse:272 | -| Resize Window (mouse) | SUPER + R | -| Toggle Mute | XF86AudioMute | -| Lock when closing Lid | switch:Lid Switch | -| Sound Up | XF86AudioRaiseVolume | -| Sound Down | XF86AudioLowerVolume | -| Brightness Up | XF86MonBrightnessUp | -| Brightness Down | XF86MonBrightnessDown | +| Kitty | SUPER + RETURN | +| Thunar | SUPER + E | +| Qutebrowser | SUPER + B | +| Bitwarden | SUPER + K | +| Lock | SUPER + L | +| Powermenu | SUPER + X | +| Launcher | SUPER + SPACE | +| Toggle HyprFocus | SHIFT + SUPER + SPACE | +| Close window | SUPER + Q | +| Toggle Floating | SUPER + T | +| Toggle Fullscreen | SUPER + F | +| Move focus left | SUPER + left | +| Move focus Right | SUPER + right | +| Move focus Up | SUPER + up | +| Move focus Down | SUPER + down | +| Focus previous monitor | SHIFT + SUPER + up | +| Focus next monitor | SHIFT + SUPER + down | +| Add to master | SHIFT + SUPER + left | +| Remove from master | SHIFT + SUPER + right | +| Screenshot window | SUPER + PRINT | +| Screenshot monitor | PRINT | +| Screenshot region | SHIFT + SUPER + PRINT | +| Screenshot region then edit | ALT PRINT | +| Search on internet with wofi | SHIFT + SUPER + S | +| Clipboard picker with wofi | SHIFT + SUPER + C | +| Emoji picker with wofi | SHIFT + SUPER + E | +| Toggle night shift | SUPER + F2 | +| Toggle night shift | SUPER + F3 | +| Move Window (mouse) | SUPER + mouse:272 | +| Resize Window (mouse) | SUPER + R | +| Toggle Mute | XF86AudioMute | +| Lock when closing Lid | switch:Lid Switch | +| Sound Up | XF86AudioRaiseVolume | +| Sound Down | XF86AudioLowerVolume | +| Brightness Up | XF86MonBrightnessUp | +| Brightness Down | XF86MonBrightnessDown | diff --git a/docs/scripts/keybindings_to_markdown.sh b/docs/scripts/keybindings_to_markdown.sh index b1f6765..f1facfb 100644 --- a/docs/scripts/keybindings_to_markdown.sh +++ b/docs/scripts/keybindings_to_markdown.sh @@ -36,24 +36,25 @@ keybindings=$(echo -e "$bind\n$bindm\n$bindl\n$bindle" | grep '"') echo "[//]: # (This file is autogenerated)" >"$KEYBINDINGS_FILE" echo "# Keybindings for Hyprland" >>"$KEYBINDINGS_FILE" echo "" >>"$KEYBINDINGS_FILE" -echo "The list of the keybindings working on Hyprland:" >>"$KEYBINDINGS_FILE" +echo "> [!NOTE]" >>"$KEYBINDINGS_FILE" +echo "> SUPER is the windows key by default" >>"$KEYBINDINGS_FILE" echo "" >>"$KEYBINDINGS_FILE" echo "| Description | Keybinding |" >>"$KEYBINDINGS_FILE" echo "| -- | -- |" >>"$KEYBINDINGS_FILE" echo "| Switch Workspace | SUPER + {Number} |" >>"$KEYBINDINGS_FILE" echo "| Move app to Workspace | SHIFT + SUPER + {Number} |" >>"$KEYBINDINGS_FILE" -echo "$keybindings" | while read line; do +echo "$keybindings" | while read -r line; do comment=$(echo "$line" | cut -d\# -f2) line=$(echo "$line" | cut -d\# -f1) line=${line:1:${#line}-3} mod=$(echo "$line" | cut -d, -f1) key=$(echo "$line" | cut -d, -f2) - dispatcher=$(echo "$line" | cut -d, -f3) - params=$(echo "$line" | cut -d, -f4) + # dispatcher=$(echo "$line" | cut -d, -f3) + # params=$(echo "$line" | cut -d, -f4) [[ $mod == '$mod' ]] && mod="SUPER + " [[ $mod == '$shiftMod' ]] && mod="SHIFT + SUPER + " - echo "| $comment | $mod$key |" >>"$KEYBINDINGS_FILE" + echo "| ${comment:1} | $mod$key |" >>"$KEYBINDINGS_FILE" done diff --git a/docs/src/README_template.md b/docs/src/README_template.md index 36b8f03..4279406 100644 --- a/docs/src/README_template.md +++ b/docs/src/README_template.md @@ -85,7 +85,8 @@ git clone https://github.com/anotherhadi/nixy ~/.config/nixos 4. Add your 'nixosConfigurations' inside `flake.nix` > [!Important] -> I added few `# CHANGEME` comments in the files to help you find what to change. Be sure to check them up +> I added few `# CHANGEME` comments in the files to help you find what to change. Be sure to check them up. +> You can use `rg "CHANGEME"` to find them all with ripgrep. > [!TIP] > When you add new files, don't forget to run `git add .` to add them to the git repository @@ -98,11 +99,11 @@ sudo nixos-rebuild switch --flake ~/.config/nixos#yourhostname ## Documentation -- [THEMES.md](docs/THEMES.md): How themes work and how to create your own -- [SCRIPTS.md](docs/SCRIPTS.md): Scripts that are available -- [KEYBINDINGS-HYPRLAND.md](docs/KEYBINDINGS-HYPRLAND.md): Keybindings available in Hyprland -- [WALLPAPERS.md](https://github.com/anotherhadi/nixy-wallpapers): A collection of wallpapers for Nixy. +- [THEMES](docs/THEMES.md): How themes work and how to create your own +- [SCRIPTS](docs/SCRIPTS.md): Scripts that are available +- [KEYBINDINGS-HYPRLAND](docs/KEYBINDINGS-HYPRLAND.md): Keybindings available in Hyprland +- [WALLPAPERS](https://github.com/anotherhadi/nixy-wallpapers): A collection of wallpapers for Nixy. -- [TODO.md](docs/TODO.md): What's next (feel free to contribute) -- [CONTRIBUTING.md](docs/CONTRIBUTING.md): How to contribute +- [TODO](docs/TODO.md): What's next (feel free to contribute) +- [CONTRIBUTING](docs/CONTRIBUTING.md): How to contribute - [LICENSE](LICENSE): MIT License diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index 35a3f72..c874a83 100644 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -1,5 +1,8 @@ { config, ... }: { imports = [ + ../../nixos/nvidia.nix # CHANGEME: Remove this line if you don't have an Nvidia GPU + ../../nixos/prime.nix # CHANGEME: Remove this line if you don't have an Nvidia GPU + ../../nixos/audio.nix ../../nixos/auto-upgrade.nix ../../nixos/bluetooth.nix @@ -7,8 +10,6 @@ ../../nixos/home-manager.nix ../../nixos/network-manager.nix ../../nixos/nix.nix - ../../nixos/nvidia.nix - ../../nixos/prime.nix ../../nixos/systemd-boot.nix ../../nixos/timezone.nix ../../nixos/tuigreet.nix diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index 2fa7354..f6568da 100644 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -33,7 +33,7 @@ ../../home/system/udiskie ../../home/system/clipman - ./secrets # You should probably remove this line + ./secrets # CHANGEME: You should probably remove this line, this is where I store my secrets ]; home = { diff --git a/hosts/laptop/secrets/default.nix b/hosts/laptop/secrets/default.nix index 51f4ddf..0447de7 100644 --- a/hosts/laptop/secrets/default.nix +++ b/hosts/laptop/secrets/default.nix @@ -1,3 +1,5 @@ +# Those are my secrets, encrypted with sops +# You shouldn't import this file, unless you edit it { pkgs, inputs, ... }: { imports = [ inputs.sops-nix.homeManagerModules.sops ]; diff --git a/hosts/laptop/variables.nix b/hosts/laptop/variables.nix index 5da131f..f65b774 100644 --- a/hosts/laptop/variables.nix +++ b/hosts/laptop/variables.nix @@ -4,7 +4,8 @@ config.var = { hostname = "nixy"; username = "hadi"; - configDirectory = "/home/" + config.var.username + "/.config/nixos"; + configDirectory = "/home/" + config.var.username + + "/.config/nixos"; # The path of the nixos configuration directory keyboardLayout = "fr"; diff --git a/nixos/prime.nix b/nixos/prime.nix index 350adcc..d7ef6d4 100644 --- a/nixos/prime.nix +++ b/nixos/prime.nix @@ -7,7 +7,11 @@ # sync.enable = true; - amdgpuBusId = "PCI:5:0:0"; - nvidiaBusId = "PCI:1:0:0"; + # CHANGEME: Change those values to match your hardware (if prime is imported) + amdgpuBusId = + "PCI:5:0:0"; # Set this to the bus ID of your AMD GPU if you have one + # intelBusId = "PCI:0:2:0"; # Set this to the bus ID of your Intel GPU if you have one + nvidiaBusId = + "PCI:1:0:0"; # Set this to the bus ID of your Nvidia GPU if you have one }; }