diff --git a/.clang-format-ignore b/.clang-format-ignore new file mode 100644 index 00000000..c6bf34ed --- /dev/null +++ b/.clang-format-ignore @@ -0,0 +1 @@ +subprojects/**/* diff --git a/.github/actions/setup_base/action.yml b/.github/actions/setup_base/action.yml new file mode 100644 index 00000000..2985ce9a --- /dev/null +++ b/.github/actions/setup_base/action.yml @@ -0,0 +1,75 @@ +name: "Setup base" + +inputs: + INSTALL_XORG_PKGS: + description: 'Install xorg dependencies' + required: false + default: false + +runs: + using: "composite" + steps: + - name: Get required pacman pkgs + shell: bash + run: | + sed -i 's/SigLevel = Required DatabaseOptional/SigLevel = Optional TrustAll/' /etc/pacman.conf + pacman --noconfirm --noprogressbar -Syyu + pacman --noconfirm --noprogressbar -Sy \ + base-devel \ + cairo \ + clang \ + cmake \ + git \ + glm \ + glslang \ + go \ + jq \ + libc++ \ + libdisplay-info \ + libdrm \ + libepoxy \ + libfontenc \ + libglvnd \ + libinput \ + libliftoff \ + libxcvt \ + libxfont2 \ + libxkbcommon \ + libxkbfile \ + lld \ + meson \ + ninja \ + pango \ + pixman \ + pkgconf \ + scdoc \ + seatd \ + systemd \ + tomlplusplus \ + wayland \ + wayland-protocols \ + xcb-util-errors \ + xcb-util-renderutil \ + xcb-util-wm + + - name: Get Xorg pacman pkgs + shell: bash + if: inputs.INSTALL_XORG_PKGS == 'true' + run: | + pacman --noconfirm --noprogressbar -Sy \ + xorg-fonts-encodings \ + xorg-server-common \ + xorg-setxkbmap \ + xorg-xkbcomp \ + xorg-xwayland + + - name: Checkout Hyprland + uses: actions/checkout@v4 + with: + submodules: recursive + + # Fix an issue with actions/checkout where the checkout repo is not mark as safe + - name: Mark directory as safe for git + shell: bash + run: | + git config --global --add safe.directory /__w/Hyprland/Hyprland diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f52c554..bedb7bbf 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -245,5 +245,6 @@ protocol("staging/tearing-control/tearing-control-v1.xml" "tearing-control-v1" f protocol("unstable/text-input/text-input-unstable-v1.xml" "text-input-unstable-v1" false) protocol("staging/cursor-shape/cursor-shape-v1.xml" "cursor-shape-v1" false) -# hyprctl +# tools add_subdirectory(hyprctl) +add_subdirectory(hyprpm) diff --git a/Makefile b/Makefile index 6213102e..a0b00259 100644 --- a/Makefile +++ b/Makefile @@ -38,8 +38,11 @@ install: mkdir -p ${PREFIX}/bin cp -f ./build/Hyprland ${PREFIX}/bin cp -f ./build/hyprctl/hyprctl ${PREFIX}/bin + cp -f ./build/hyprpm/hyprpm ${PREFIX}/bin chmod 755 ${PREFIX}/bin/Hyprland chmod 755 ${PREFIX}/bin/hyprctl + chmod 755 ${PREFIX}/bin/hyprpm + ln -s -r ${PREFIX}/bin/Hyprland ${PREFIX}/bin/hyprland if [ ! -f ${PREFIX}/share/wayland-sessions/hyprland.desktop ]; then cp ./example/hyprland.desktop ${PREFIX}/share/wayland-sessions; fi mkdir -p ${PREFIX}/share/hyprland cp ./assets/wall_* ${PREFIX}/share/hyprland @@ -58,6 +61,7 @@ uninstall: rm -f ${PREFIX}/share/wayland-sessions/hyprland.desktop rm -f ${PREFIX}/bin/Hyprland rm -f ${PREFIX}/bin/hyprctl + rm -f ${PREFIX}/bin/hyprpm rm -f ${PREFIX}/lib/libwlroots.so.13032 rm -rf ${PREFIX}/share/hyprland rm -f ${PREFIX}/share/man/man1/Hyprland.1 diff --git a/example/hyprland.conf b/example/hyprland.conf index e6c2a641..62b6e6e5 100644 --- a/example/hyprland.conf +++ b/example/hyprland.conf @@ -23,8 +23,10 @@ monitor=,preferred,auto,auto $terminal = kitty $fileManager = dolphin $menu = wofi --show drun + # Some default env vars. env = XCURSOR_SIZE,24 +env = QT_QPA_PLATFORMTHEME,qt5ct # change to qt6ct if you have that # For all categories, see https://wiki.hyprland.org/Configuring/Variables/ input { diff --git a/flake.lock b/flake.lock index a7743fd0..f7761728 100644 --- a/flake.lock +++ b/flake.lock @@ -25,11 +25,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1700612854, - "narHash": "sha256-yrQ8osMD+vDLGFX7pcwsY/Qr5PUd6OmDMYJZzZi0+zc=", + "lastModified": 1703438236, + "narHash": "sha256-aqVBq1u09yFhL7bj1/xyUeJjzr92fXVvQSSEx6AdB1M=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "19cbff58383a4ae384dea4d1d0c823d72b49d614", + "rev": "5f64a12a728902226210bf01d25ec6cbb9d9265b", "type": "github" }, "original": { @@ -95,11 +95,11 @@ ] }, "locked": { - "lastModified": 1700508250, - "narHash": "sha256-X4o/mifI7Nhu0UKYlxx53wIC+gYDo3pVM9L2u3PE2bE=", + "lastModified": 1703514399, + "narHash": "sha256-VRr5Xc4S/VPr/gU3fiOD3vSIL2+GJ+LUrmFTWTwnTz4=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "eb120ff25265ecacd0fc13d7dab12131b60d0f47", + "rev": "0a318a7a217a6402b0b705837cd5b50b0e94b31b", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index a6d723f2..6807c0f3 100644 --- a/flake.nix +++ b/flake.nix @@ -62,12 +62,16 @@ inherit (pkgsFor.${system}) # hyprland-packages + hyprland hyprland-unwrapped hyprland-debug + hyprland-legacy-renderer # hyprland-extras + xdg-desktop-portal-hyprland # dependencies + hyprland-protocols wlroots-hyprland udis86 @@ -75,17 +79,18 @@ }); devShells = eachSystem (system: { - default = pkgsFor.${system}.mkShell.override { - stdenv = pkgsFor.${system}.gcc13Stdenv; - } { - name = "hyprland-shell"; - nativeBuildInputs = with pkgsFor.${system}; [cmake python3]; - buildInputs = [self.packages.${system}.wlroots-hyprland]; - inputsFrom = [ - self.packages.${system}.wlroots-hyprland - self.packages.${system}.hyprland - ]; - }; + default = + pkgsFor.${system}.mkShell.override { + stdenv = pkgsFor.${system}.gcc13Stdenv; + } { + name = "hyprland-shell"; + nativeBuildInputs = with pkgsFor.${system}; [cmake python3]; + buildInputs = [self.packages.${system}.wlroots-hyprland]; + inputsFrom = [ + self.packages.${system}.wlroots-hyprland + self.packages.${system}.hyprland + ]; + }; }); formatter = eachSystem (system: nixpkgs.legacyPackages.${system}.alejandra); diff --git a/hyprctl/main.cpp b/hyprctl/main.cpp index a53c4c3f..f11cac6e 100644 --- a/hyprctl/main.cpp +++ b/hyprctl/main.cpp @@ -23,39 +23,49 @@ #include #include -const std::string USAGE = R"#(usage: hyprctl [(opt)flags] [command] [(opt)args] - -commands: - activewindow - activeworkspace - binds - clients - cursorpos - devices - dispatch - getoption - globalshortcuts - hyprpaper - instances - keyword - kill - layers - layouts - monitors - notify - plugin - reload - setcursor - seterror - setprop - splash - switchxkblayout - version - workspacerules - workspaces - -flags: +const std::string USAGE = R"#(usage: hyprctl [flags] [ [args]] + hyprctl --batch { [args] ; [args] ; ...} +LISTING COMMANDS: + monitors: List outputs + workspaces: List all workspaces + activeworkspace: Get currently active workspace + clients: List clients (e.g. windows) + activewindow: Get currently active window + layers: List layers + animations: List animations and bezier curves in use + devices: List devices + binds: List registered binds + instances: List running Hyprland instances + layouts: List layouts + globalshortcuts: List global shortcuts + version: Print hyprland version +CONFIGURATION COMMANDS: + keyword [args]: Execute a keyword + getoption