From 84f87f98334b8c8dd12e68cbd21c058f3797a4fd Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Thu, 27 Jun 2024 19:42:08 +0200 Subject: [PATCH] Update --- docs/APPS.md | 58 ++++++++++----------- docs/KEYBINDINGS.md | 68 ++++++++++++------------- docs/TODO.md | 5 +- docs/scripts/keybindings_to_markdown.sh | 3 ++ home/programs/nvim/default.nix | 2 +- home/programs/nvim/keymaps.nix | 6 ++- home/programs/nvim/plugins/lsp.nix | 4 +- home/scripts/caffeine/default.nix | 11 +++- home/scripts/night-shift/default.nix | 20 +++++++- home/system/udiskie/default.nix | 1 - home/system/waybar/default.nix | 36 +++++++++---- hosts/laptop/home.nix | 1 + hosts/modules/variables-configtest.nix | 18 +++---- 13 files changed, 138 insertions(+), 95 deletions(-) diff --git a/docs/APPS.md b/docs/APPS.md index 1f36b4e..523f15a 100644 --- a/docs/APPS.md +++ b/docs/APPS.md @@ -7,35 +7,35 @@ The laptop configuration is used by an Omen 16 laptop w/ nvidia and an amd gpu running NixOS. The configurations files can be found in the `hosts/laptop` directory. -| Category | Name | -|----------------|---------------| -| WM | Hyprland | -| | hyprlock | -| | hyprpaper | -| | hypridle | -| | wlogout | -| Bar | waybar | -| Terminal | kitty | -| Shell | zsh | -| | tmux | -| | starship | -| | bat | -| | eza | -| | zoxide | -| | fzf | -| Editor | neovim(nixvim)| -| File manager | lf | -| | thunar | -| Browser | qutebrowser | -| Music | spicetify | -| Notifications | dunst | -| Launcher | wofi | -| DM | tuigreet | -| Secrets | sops-nix | -| Misc | lazygit | -| | neofetch | -| | cava | -| See [hosts/laptop](../hosts/laptop/)... | | +| Category | Name | +|-----------------------------------------|----------------| +| WM | Hyprland | +| | hyprlock | +| | hyprpaper | +| | hypridle | +| | wlogout | +| Bar | waybar | +| Terminal | kitty | +| Shell | zsh | +| | tmux | +| | starship | +| | bat | +| | eza | +| | zoxide | +| | fzf | +| Editor | neovim(nixvim) | +| File manager | lf | +| | thunar | +| Browser | qutebrowser | +| Music | spicetify | +| Notifications | dunst | +| Launcher | wofi | +| DM | tuigreet | +| Secrets | sops-nix | +| Misc | lazygit | +| | neofetch | +| | cava | +| See [hosts/laptop](../hosts/laptop/)... | | ## Server diff --git a/docs/KEYBINDINGS.md b/docs/KEYBINDINGS.md index f2c386f..14e3d1d 100644 --- a/docs/KEYBINDINGS.md +++ b/docs/KEYBINDINGS.md @@ -2,37 +2,37 @@ The list of the keybindings working on Hyprland: -| Description | Keybinding | Command | -| -- | -- | -- | -| Switch Workspace | SUPER + {Number} | workspace {Number} | -| Move app to Workspace | SUPER SHIFT + {Number} | movetoworkspace {Number} | -| Kitty | SUPER + RETURN | exec ${pkgs.kitty}/bin/kitty | -| Thunar | SUPER + E | exec ${pkgs.xfce.thunar}/bin/thunar | -| Qutebrowser | SUPER + B | exec ${pkgs.qutebrowser}/bin/qutebrowser | -| Bitwarden | SUPER + K | exec ${pkgs.bitwarden}/bin/bitwarden | -| Peaclock | SUPER + C | exec ${pkgs.kitty}/bin/kitty --class peaclock peaclock | -| Lock | SUPER + L | exec ${pkgs.hyprlock}/bin/hyprlock | -| Powermenu | SUPER + X | exec powermenu | -| Launcher | SUPER + SPACE | exec menu | -| Close window | SUPER + Q | killactive | -| Toggle Floating | SUPER + T | togglefloating | -| Toggle Fullscreen | SUPER + F | fullscreen | -| Move focus left | SUPER + left | movefocus l | -| Move focus Right | SUPER + right | movefocus r | -| Move focus Up | SUPER + up | movefocus u | -| Move focus Down | SUPER + down | movefocus d | -| Screenshot window | SUPER + PRINT | exec screenshot window | -| Screenshot monitor | PRINT | exec screenshot monitor | -| Screenshot region | SUPER SHIFT + PRINT | exec screenshot region | -| Screenshot region then edit | ALT PRINT | exec screenshot region swappy | -| Turn off night shift | SUPER + F2 | exec night-shift-off | -| Turn on night shift | SUPER + F3 | exec night-shift-on | -| Choose sound output | SUPER + F5 | exec ${pkgs.kitty}/bin/kitty --class floating zsh -c sound-output | -| Move Window (mouse) | SUPER + mouse:272 | movewindow | -| Resize Window (mouse) | SUPER + R | resizewindow | -| Toggle Mute | XF86AudioMute | exec sound-toggle | -| Lock when closing Lid | switch:Lid Switch | exec ${pkgs.hyprlock}/bin/hyprlock | -| Sound Up | XF86AudioRaiseVolume | exec sound-up | -| Sound Down | XF86AudioLowerVolume | exec sound-down | -| Brightness Up | XF86MonBrightnessUp | exec brightness-up | -| Brightness Down | XF86MonBrightnessDown | exec brightness-down | +| Description | Keybinding | Command | +|-----------------------------|------------------------|--------------------------------------------------------------------| +| Switch Workspace | SUPER + {Number} | workspace {Number} | +| Move app to Workspace | SUPER SHIFT + {Number} | movetoworkspace {Number} | +| Kitty | SUPER + RETURN | exec \${pkgs.kitty}/bin/kitty | +| Thunar | SUPER + E | exec \${pkgs.xfce.thunar}/bin/thunar | +| Qutebrowser | SUPER + B | exec \${pkgs.qutebrowser}/bin/qutebrowser | +| Bitwarden | SUPER + K | exec \${pkgs.bitwarden}/bin/bitwarden | +| Peaclock | SUPER + C | exec \${pkgs.kitty}/bin/kitty --class peaclock peaclock | +| Lock | SUPER + L | exec \${pkgs.hyprlock}/bin/hyprlock | +| Powermenu | SUPER + X | exec powermenu | +| Launcher | SUPER + SPACE | exec menu | +| Close window | SUPER + Q | killactive | +| Toggle Floating | SUPER + T | togglefloating | +| Toggle Fullscreen | SUPER + F | fullscreen | +| Move focus left | SUPER + left | movefocus l | +| Move focus Right | SUPER + right | movefocus r | +| Move focus Up | SUPER + up | movefocus u | +| Move focus Down | SUPER + down | movefocus d | +| Screenshot window | SUPER + PRINT | exec screenshot window | +| Screenshot monitor | PRINT | exec screenshot monitor | +| Screenshot region | SUPER SHIFT + PRINT | exec screenshot region | +| Screenshot region then edit | ALT PRINT | exec screenshot region swappy | +| Turn off night shift | SUPER + F2 | exec night-shift-off | +| Turn on night shift | SUPER + F3 | exec night-shift-on | +| Choose sound output | SUPER + F5 | exec \${pkgs.kitty}/bin/kitty --class floating zsh -c sound-output | +| Move Window (mouse) | SUPER + mouse:272 | movewindow | +| Resize Window (mouse) | SUPER + R | resizewindow | +| Toggle Mute | XF86AudioMute | exec sound-toggle | +| Lock when closing Lid | switch:Lid Switch | exec \${pkgs.hyprlock}/bin/hyprlock | +| Sound Up | XF86AudioRaiseVolume | exec sound-up | +| Sound Down | XF86AudioLowerVolume | exec sound-down | +| Brightness Up | XF86MonBrightnessUp | exec brightness-up | +| Brightness Down | XF86MonBrightnessDown | exec brightness-down | diff --git a/docs/TODO.md b/docs/TODO.md index 61c94c4..72b949a 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -10,13 +10,14 @@ feel free to contribute <3 ([CONTRIBUTING.md](CONTRIBUTING.md)) - [ ] macOS theme - [~] Tofi (Wofi, but terminal based) - [ ] Add Vim Keybindings to KEYBINDINGS.md + - [ ] Keybindings with Icons - [ ] Qutebrowser - [~] Bitwarden integration (I need this.) - [ ] Waybar - - [~] Caffeine status - - [ ] Night-shift status + - [ ] Caffeine status on click + - [ ] Night-shift status on click - [ ] Hyprland - [ ] Implement Hyprcursor (see home/system/hyprland/hyprcursor.nix: Not working, small cursor on some apps, big one on others) diff --git a/docs/scripts/keybindings_to_markdown.sh b/docs/scripts/keybindings_to_markdown.sh index 1e42fcb..5aad391 100644 --- a/docs/scripts/keybindings_to_markdown.sh +++ b/docs/scripts/keybindings_to_markdown.sh @@ -59,3 +59,6 @@ echo "$keybindings" | while read line; do echo "| $comment | $mod$key | $dispatcher $params |" >>"$KEYBINDINGS_FILE" done + +pandoc -t commonmark_x "$KEYBINDINGS_FILE" -o "/tmp/keybindings.md" +mv "/tmp/keybindings.md" "$KEYBINDINGS_FILE" diff --git a/home/programs/nvim/default.nix b/home/programs/nvim/default.nix index 05cad16..3f9e2e4 100644 --- a/home/programs/nvim/default.nix +++ b/home/programs/nvim/default.nix @@ -24,7 +24,7 @@ ./plugins/noice.nix ./plugins/obsidian.nix ./plugins/image.nix - ./plugins/ltex.nix + # ./plugins/ltex.nix ./plugins/flash.nix ./plugins/zen-mode.nix ./options.nix diff --git a/home/programs/nvim/keymaps.nix b/home/programs/nvim/keymaps.nix index dca6fb7..dec29ab 100644 --- a/home/programs/nvim/keymaps.nix +++ b/home/programs/nvim/keymaps.nix @@ -10,7 +10,11 @@ action = "lua vim.lsp.buf.format()"; options.desc = "LSP Format"; } - + { + key = "ox"; + action = "vip:!pandoc -t commonmark_x"; + options.desc = "Format Markdown Tables"; + } { key = "ot"; action = "lua require('obsidian').util.toggle_checkbox()"; diff --git a/home/programs/nvim/plugins/lsp.nix b/home/programs/nvim/plugins/lsp.nix index 7529e42..7f62378 100644 --- a/home/programs/nvim/plugins/lsp.nix +++ b/home/programs/nvim/plugins/lsp.nix @@ -13,9 +13,9 @@ svelte.enable = true; marksman.enable = true; ltex = { - enable = true; + enable = false; settings = { - enabled = true; + enabled = false; language = "en"; }; }; diff --git a/home/scripts/caffeine/default.nix b/home/scripts/caffeine/default.nix index ffe5650..e589e21 100644 --- a/home/scripts/caffeine/default.nix +++ b/home/scripts/caffeine/default.nix @@ -17,4 +17,13 @@ let notif "caffeine" "$message" ''; -in { home.packages = [ caffeine-status caffeine ]; } + caffeine-status-icon = pkgs.writeShellScriptBin "caffeine-status-icon" '' + status=$(caffeine-status) + if [[ $status == "active" ]]; then + echo "󰅶" + else + echo "󰾪" + fi + ''; + +in { home.packages = [ caffeine-status caffeine caffeine-status-icon ]; } diff --git a/home/scripts/night-shift/default.nix b/home/scripts/night-shift/default.nix index 34db3c6..fce0b52 100644 --- a/home/scripts/night-shift/default.nix +++ b/home/scripts/night-shift/default.nix @@ -24,11 +24,27 @@ let ''; night-shift-status = pkgs.writeShellScriptBin "night-shift-status" '' - if pgrep wlsunset; then + if [[ $(pgrep wlsunset) ]]; then echo "1" else echo "0" fi ''; -in { home.packages = [ night-shift-on night-shift-off night-shift-toggle night-shift-status ]; } + night-shift-status-icon = + pkgs.writeShellScriptBin "night-shift-status-icon" '' + if [[ $(pgrep wlsunset) ]]; then + echo "󰖔" + else + echo "󰖕" + fi + ''; +in { + home.packages = [ + night-shift-on + night-shift-off + night-shift-toggle + night-shift-status + night-shift-status-icon + ]; +} diff --git a/home/system/udiskie/default.nix b/home/system/udiskie/default.nix index 87c3ab8..decab95 100644 --- a/home/system/udiskie/default.nix +++ b/home/system/udiskie/default.nix @@ -1,7 +1,6 @@ { services.udiskie = { enable = true; - tray = "always"; notify = true; automount = true; }; diff --git a/home/system/waybar/default.nix b/home/system/waybar/default.nix index c14beff..17d7488 100644 --- a/home/system/waybar/default.nix +++ b/home/system/waybar/default.nix @@ -33,8 +33,16 @@ height = 44; modules-left = [ "custom/logo" "hyprland/window" ]; modules-center = [ "hyprland/workspaces" ]; - modules-right = - [ "tray" "backlight" "pulseaudio" "battery" "clock" "custom/power" ]; + modules-right = [ + "tray" + "backlight" + "pulseaudio" + "custom/caffeine" + "custom/night-shift" + "battery" + "clock" + "custom/power" + ]; "wlr/taskbar" = { format = "{icon}"; @@ -124,14 +132,20 @@ tooltip = false; on-click = "powermenu"; }; - # "custom/caffeine": { - # "format": "{}", - # "max-length": 5, - # "interval": 10, - # "exec": "caffeine-status-icon", - # "exec-if": "pgrep spotify", - # "return-type": "" - #} + "custom/caffeine" = { + format = "{}"; + max-length = 5; + interval = 10; + exec = "caffeine-status-icon"; + # exec-if = "pgrep spotify"; + # return-type = ""; + }; + "custom/night-shift" = { + format = "{}"; + max-length = 5; + interval = 10; + exec = "night-shift-status-icon"; + }; backlight = { device = "nvidia_0"; format = "{icon}"; @@ -218,6 +232,8 @@ #memory, #custom-power, + #custom-caffeine, + #custom-night-shift, #battery, #backlight, #pulseaudio, diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index bafc208..38ad47f 100644 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -78,6 +78,7 @@ optipng pfetch usbutils + pandoc # Just cool peaclock diff --git a/hosts/modules/variables-configtest.nix b/hosts/modules/variables-configtest.nix index 2ff90bc..5067b0d 100644 --- a/hosts/modules/variables-configtest.nix +++ b/hosts/modules/variables-configtest.nix @@ -1,19 +1,12 @@ { lib, ... }: { options = { var = { - - hostname = lib.mkOption { - type = lib.types.string; - default = ""; - description = ""; - }; - hostname = lib.mkOption { type = lib.types.string; default = "nixy"; description = "Hostname"; }; - + username = lib.mkOption { type = lib.types.string; default = "user"; @@ -26,7 +19,6 @@ description = "Home directory (/home/user)"; }; - configDirectory = lib.mkOption { type = lib.types.string; default = "/home/user/.config/nixos"; @@ -78,13 +70,15 @@ sops = lib.mkOption { type = lib.types.bool; default = false; - description = "Enable sops (You should set up sops for your own config)"; + description = + "Enable sops (You should set up sops for your own config)"; }; obsidian = lib.mkOption { type = lib.types.bool; default = false; - description = "Enable obsidian.nvim (You should set up obsidian.nvim for your own config)"; + description = + "Enable obsidian.nvim (You should set up obsidian.nvim for your own config)"; }; tailscale = lib.mkOption { @@ -124,7 +118,7 @@ type = lib.types.string; default = "FiraCode Nerd Font Mono"; description = "Monospace Font"; - }; + }; }; };