dotfiles

My PC Dotfiles & Website
commit b05208bb1c3b5ba3161c91465a271eb017906f65
parent 9ca3a3c3793e724f08894b7c6989e7774b1a83b6
Author: maydayv7 <maydayv7@gmail.com>
Date:   Sat, 20 Apr 2024 11:01:30 +0530

feat: Add more `hyprutils`

Also update README

Diffstat:

A.github/devcontainer | 2++
MREADME.md | 11++++-------
Dchecks/devcontainer | 2--
Mdevices/futura.nix | 5+----
Mfiles/hyprland/binds.pango | 2+-
Mflake.lock | 36++++++++++++++----------------------
Mflake.nix | 3+--
Mmodules/gui/default.nix | 2+-
Mmodules/gui/desktop/hyprland/settings/default.nix | 2+-
Mmodules/gui/desktop/hyprland/settings/keybindings.nix | 5+++--
Mmodules/gui/desktop/hyprland/settings/plugins.nix | 2+-
Mpackages/wine/7zip.nix | 4++--
Mscripts/hyprutils.nix | 67+++++++++++++++++++++++++++++++++++++++++--------------------------
13 files changed, 72 insertions(+), 71 deletions(-)

diff --git a/.github/devcontainer b/.github/devcontainer @@ -0,0 +1 @@ +../.devcontainer +\ No newline at end of file diff --git a/README.md b/README.md @@ -383,14 +383,14 @@ This repository contains my personal configuration, and may cause undesirable ef It is not recommended to use NixOS if you are a beginner just starting out, without acquaintance with either the command-line or functional programming languages, since the learning curve is steep, debugging issues is difficult, documentation is shallow, and the effort required/time spent isn't worth the hassle for a novice/casual user -### Requirements +### Platform _May change according to available hardware_ -- UEFI Compatible System -- Intel CPU + iGPU +This configuration works well with an Intel CPU + iGPU, and is not tested with anything else +The `hardware.modules` option can be used to load relevant configuration from [`nixos-hardware`](https://github.com/nixos/nixos-hardware) -See [this](./modules/hardware/README.md) for additional hardware information +See [this](./modules/hardware/README.md) for additional information ### Build @@ -750,10 +750,7 @@ You can navigate to the `README`s present in the various directories to know mor <details> <summary><b>Known Limitations</b></summary> -- It is a hard requirement to clone the repository to `/etc/nixos` in order to use it as intended - Home Configuration can't be decoupled from System -- Lack of automatic script checking -- Currently using a workaround for CI due to NixOS/nix#3978 - [Wine](./packages/wine) Applications have to be manually updated </details> diff --git a/checks/devcontainer b/checks/devcontainer @@ -1 +0,0 @@ -../.devcontainer -\ No newline at end of file diff --git a/devices/futura.nix b/devices/futura.nix @@ -17,10 +17,7 @@ }; apps.list = ["firefox" "office"]; - gui = { - desktop = "xfce"; - display = "eDP-1"; - }; + gui.desktop = "xfce"; # User Navya user = { diff --git a/files/hyprland/binds.pango b/files/hyprland/binds.pango @@ -41,7 +41,7 @@ <tt>$mod ?</tt> Show this page <tt>$mod A</tt> Application Drawer <tt>$mod SHIFT C</tt> Color Picker -<tt>$mod D</tt> Monitor Configuration +<tt>$mod [SHIFT] D</tt> Monitor Configuration [Toggle main Display] <tt>$mod F</tt> File Manager <tt>$mod T</tt> Terminal <tt>$mod Shift T</tt> Toggle Terminal in Quake mode diff --git a/flake.lock b/flake.lock @@ -525,11 +525,11 @@ ] }, "locked": { - "lastModified": 1713156476, - "narHash": "sha256-CDWaSJhsWgoHE43lCI+AUPt8hyTt8gb1rrQsJka+trg=", + "lastModified": 1713447438, + "narHash": "sha256-6WgXIc5h8DTbLzdKrkGmJusCZfaNeT/XK+EX3wqQ5LI=", "owner": "DreamMaoMao", "repo": "hycov", - "rev": "10ecd517f1e0dc51e4c2b9e114a7a24e765d1bed", + "rev": "2c25830474ed41058accf87568991d3444b16537", "type": "github" }, "original": { @@ -580,16 +580,16 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1713120508, - "narHash": "sha256-piBUBQsQ8R20/lX9GMJjwdntal6yfJZMVCIi21XCZ8Y=", + "lastModified": 1713283263, + "narHash": "sha256-Urb/njWiHYUudXpmK8EKl9Z58esTIG0PxXw5LuM2r5g=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "e93fbd7c4f991cb8ef03e433ccc4d43587923e15", + "rev": "fe7b748eb668136dd0558b7c8279bfcd7ab4d759", "type": "github" }, "original": { "owner": "hyprwm", - "ref": "v0.39.0", + "ref": "v0.39.1", "repo": "Hyprland", "type": "github" } @@ -673,22 +673,14 @@ "inputs": { "hyprland": [ "hyprland" - ], - "hyprlandPlugins": [ - "hyprland-plugins" - ], - "nixpkgs": [ - "hyprspace", - "hyprland", - "nixpkgs" ] }, "locked": { - "lastModified": 1713240951, - "narHash": "sha256-Nvbn1baUNN7AQOA1hHunUHuFziF0dErqaTlfxr9NNwo=", + "lastModified": 1713480110, + "narHash": "sha256-AUGdqvZs3C2wJziAzbxccXMvXW+4/41TAuyRE0IG8Yc=", "owner": "KZDKM", "repo": "Hyprspace", - "rev": "954eda50aca5ef986c557f3b515c4321fd3c7fd8", + "rev": "fc8d5f4152e4a935838b25e9f4da0fc5e958baba", "type": "github" }, "original": { @@ -1316,17 +1308,17 @@ "wlroots": { "flake": false, "locked": { - "lastModified": 1712935342, - "narHash": "sha256-zzIbTFNFd/as42jyGx23fil2uBDYYv+8GA5JmRq5y9c=", + "lastModified": 1713124002, + "narHash": "sha256-vPeZCY+sdiGsz4fl3AVVujfyZyQBz6+vZdkUE4hQ+HI=", "owner": "hyprwm", "repo": "wlroots-hyprland", - "rev": "62eeffbe233d199f520a5755c344e85f8eab7940", + "rev": "611a4f24cd2384378f6e500253983107c6656c64", "type": "github" }, "original": { "owner": "hyprwm", "repo": "wlroots-hyprland", - "rev": "62eeffbe233d199f520a5755c344e85f8eab7940", + "rev": "611a4f24cd2384378f6e500253983107c6656c64", "type": "github" } }, diff --git a/flake.nix b/flake.nix @@ -145,7 +145,7 @@ # Hyprland hyprland = { - url = "github:hyprwm/Hyprland?ref=v0.39.0"; + url = "github:hyprwm/Hyprland?ref=v0.39.1"; inputs.systems.follows = "systems"; }; @@ -162,7 +162,6 @@ hyprspace = { url = "github:KZDKM/Hyprspace"; inputs.hyprland.follows = "hyprland"; - inputs.hyprlandPlugins.follows = "hyprland-plugins"; }; # Declarative Flatpak Wrapper diff --git a/modules/gui/default.nix b/modules/gui/default.nix @@ -17,7 +17,7 @@ in { display = mkOption { description = "Main GUI Display"; type = types.str; - default = ""; + default = "eDP-1"; example = "HDMI-A-1"; }; desktop = mkOption { diff --git a/modules/gui/desktop/hyprland/settings/default.nix b/modules/gui/desktop/hyprland/settings/default.nix @@ -24,7 +24,7 @@ in { debug.disable_logs = false; # Display - monitor = ",preferred,auto,1"; + monitor = ", preferred, auto, 1"; xwayland.force_zero_scaling = true; input = { diff --git a/modules/gui/desktop/hyprland/settings/keybindings.nix b/modules/gui/desktop/hyprland/settings/keybindings.nix @@ -1,4 +1,4 @@ -_: { +{sys, ...}: { ## Compositor Keybindings wayland.windowManager.hyprland.settings = { "$mod" = "SUPER"; @@ -10,6 +10,7 @@ _: { "$mod, M, fullscreen, 1" "$mod SHIFT, M, fullscreen," "$mod, Space, togglesplit" + "$mod SHIFT, D, exec, hyprutils toggle monitor ${sys.gui.display}" # Window Focus "$mod, left, movefocus, l" @@ -32,7 +33,7 @@ _: { # Floating Mode "$mod, semicolon, togglefloating," - "$mod, apostrophe, workspaceopt, allfloat" + "$mod, apostrophe, exec, hyprutils toggle float" "$mod, C, centerwindow" # Window Minimization diff --git a/modules/gui/desktop/hyprland/settings/plugins.nix b/modules/gui/desktop/hyprland/settings/plugins.nix @@ -47,7 +47,7 @@ in { # Workspace Overview overview { - autoDrag = false + autoDrag = true exitOnClick = true centerAligned = true hideTopLayers = true diff --git a/packages/wine/7zip.nix b/packages/wine/7zip.nix @@ -12,10 +12,10 @@ in mkWindowsApp rec { inherit wine; pname = "7zip"; - version = "2201"; + version = "2404"; src = fetchurl { url = "https://www.7-zip.org/a/7z${version}.exe"; - sha256 = "sha256-jI+8+A8EhLSKB70g5RKxA5aZktv4G2WIgysIIF46G0M="; + sha256 = "sha256-0Mj79dcm5B2F5RVZI0tbOUVSLoQgjfUjntJfAu9j7/M="; }; dontUnpack = true; diff --git a/scripts/hyprutils.nix b/scripts/hyprutils.nix @@ -17,9 +17,11 @@ media [next,previous,toggle] - Media Controls zoom [in,out] - Screen Zoom toggle  - media - Persist and toggle audio playing state - idle - Toggle Idle Daemon service fancy - Toggle Compositor Effects + float - Toggle window floating in current workspace + idle - Toggle Idle Daemon service + media - Persist and toggle audio playing state + monitor - Toggle specified Monitor ''; in recursiveUpdate { @@ -200,30 +202,6 @@ in ;; "toggle") case "$2" in - "media") - FILE="$TEMP/toggle_media" - if test -f "$FILE" - then - rm "$FILE" - playerctl play - exit 0 - fi - if playerctl status | grep Playing - then - touch "$FILE" - playerctl pause -a - fi - ;; - "idle") - if systemctl --user is-active swayidle - then - systemctl --user stop swayidle - notify idle -i "system-lock-screen" "Stopped Idle Daemon" - else - systemctl --user restart swayidle - notify idle -i "system-lock-screen" "Started Idle Daemon" - fi - ;; "fancy") FANCY=$(hyprctl getoption animations:enabled | awk 'NR==1{print $2}') if [ "$FANCY" = 1 ] @@ -242,6 +220,43 @@ in hyprctl notify 1 2000 0 "Compositor Effects Enabled" hyprctl reload ;; + "float") + WORKSPACE=$(hyprctl activeworkspace | grep "workspace ID" | awk '{print $3}') + hyprctl notify 1 2000 0 "Toggle window floating on Workspace $WORKSPACE" + hyprctl dispatch workspaceopt allfloat + ;; + "idle") + if systemctl --user is-active swayidle + then + systemctl --user stop swayidle + notify idle -i "system-lock-screen" "Stopped Idle Daemon" + else + systemctl --user restart swayidle + notify idle -i "system-lock-screen" "Started Idle Daemon" + fi + ;; + "media") + FILE="$TEMP/toggle_media" + if test -f "$FILE" + then + rm "$FILE" + playerctl play + exit 0 + fi + if playerctl status | grep Playing + then + touch "$FILE" + playerctl pause -a + fi + ;; + "monitor") + if hyprctl monitors | grep "$3" + then + hyprctl keyword monitor "$3, disable" + else + hyprctl keyword monitor "$3, preferred, auto, 1" + fi + ;; "") error "Expected an Option" "Try 'hyprutils help' for more information" ;; *) error "Unexpected Option 'toggle $2'" "Try 'hyprutils help' for more information" ;; esac