Merge branch 'master' into 'master'

Import NMU, new upstream release, fix RC bugs

See merge request NyxTrail/hyprpaper!1
This commit is contained in:
Loong Jin Chow 2026-01-02 05:15:31 +00:00
commit 9f60dec8a3
11 changed files with 163 additions and 57 deletions

View File

@ -10,17 +10,41 @@ jobs:
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
submodules: recursive submodules: recursive
- name: Install nix
uses: cachix/install-nix-action@v20 - name: Install Nix
uses: nixbuild/nix-quick-install-action@v31
with: with:
install_url: https://nixos.org/nix/install nix_conf: |
extra_nix_config: | keep-env-derivations = true
auto-optimise-store = true keep-outputs = true
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
experimental-features = nix-command flakes - name: Restore and save Nix store
uses: nix-community/cache-nix-action@v6
with:
# restore and save a cache using this key
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
# if there's no cache hit, restore a cache by this prefix
restore-prefixes-first-match: nix-${{ runner.os }}-
# collect garbage until the Nix store size (in bytes) is at most this number
# before trying to save a new cache
# 1G = 1073741824
gc-max-store-size-linux: 1G
# do purge caches
purge: true
# purge all versions of the cache
purge-prefixes: nix-${{ runner.os }}-
# created more than this number of seconds ago
purge-created: 0
# or, last accessed more than this number of seconds ago
# relative to the start of the `Post Restore and save Nix store` phase
purge-last-accessed: 0
# except any version with the key that is the same as the `primary-key`
purge-primary-key: never
- uses: cachix/cachix-action@v12 - uses: cachix/cachix-action@v12
with: with:
name: hyprland name: hyprland
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Build Hyprpaper with default settings - name: Build Hyprpaper with default settings
run: nix build --print-build-logs --accept-flake-config run: nix build --print-build-logs --accept-flake-config

View File

@ -28,7 +28,7 @@ execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process( execute_process(
COMMAND bash -c "git show ${GIT_COMMIT_HASH} | head -n 5 | tail -n 1 | sed -s 's/\#//g'" COMMAND bash -c "git show ${GIT_COMMIT_HASH} | head -n 5 | tail -n 1 | sed -s 's/\#//g; s/^[[:space:]]*//'"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_MESSAGE OUTPUT_VARIABLE GIT_COMMIT_MESSAGE
OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_STRIP_TRAILING_WHITESPACE)
@ -54,7 +54,7 @@ pkg_check_modules(
REQUIRED REQUIRED
IMPORTED_TARGET IMPORTED_TARGET
wayland-client wayland-client
wayland-protocols wayland-protocols>=1.35
cairo cairo
pango pango
pangocairo pangocairo
@ -107,11 +107,12 @@ protocolnew("stable/xdg-shell" "xdg-shell" false)
protocolnew("staging/cursor-shape" "cursor-shape-v1" false) protocolnew("staging/cursor-shape" "cursor-shape-v1" false)
protocolnew("stable/tablet" "tablet-v2" false) protocolnew("stable/tablet" "tablet-v2" false)
string(REPLACE "\"" " " GIT_COMMIT_MESSAGE_ESCAPED "${GIT_COMMIT_MESSAGE}")
target_compile_definitions(hyprpaper target_compile_definitions(hyprpaper
PRIVATE "-DGIT_COMMIT_HASH=\"${GIT_COMMIT_HASH}\"") PRIVATE "-DGIT_COMMIT_HASH=\"${GIT_COMMIT_HASH}\"")
target_compile_definitions(hyprpaper PRIVATE "-DGIT_BRANCH=\"${GIT_BRANCH}\"") target_compile_definitions(hyprpaper PRIVATE "-DGIT_BRANCH=\"${GIT_BRANCH}\"")
target_compile_definitions( target_compile_definitions(hyprpaper
hyprpaper PRIVATE "-DGIT_COMMIT_MESSAGE=\"${GIT_COMMIT_MESSAGE}\"") PRIVATE "-DGIT_COMMIT_MESSAGE=\"${GIT_COMMIT_MESSAGE_ESCAPED}\"")
target_compile_definitions(hyprpaper PRIVATE "-DGIT_DIRTY=\"${GIT_DIRTY}\"") target_compile_definitions(hyprpaper PRIVATE "-DGIT_DIRTY=\"${GIT_DIRTY}\"")
target_link_libraries(hyprpaper rt) target_link_libraries(hyprpaper rt)
@ -142,4 +143,4 @@ endif(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES DEBUG)
include(GNUInstallDirs) include(GNUInstallDirs)
install(TARGETS hyprpaper) install(TARGETS hyprpaper)
install(FILES ${CMAKE_BINARY_DIR}/systemd/hyprpaper.service DESTINATION ${CMAKE_INSTALL_LIBDIR}/systemd/user) install(FILES ${CMAKE_BINARY_DIR}/systemd/hyprpaper.service DESTINATION "lib/systemd/user")

View File

@ -1 +1 @@
0.7.4 0.7.6

37
debian/changelog vendored
View File

@ -1,15 +1,46 @@
hyprpaper (0.7.4-1) unstable; urgency=medium hyprpaper (0.7.6-1) unstable; urgency=medium
* New upstream version 0.7.4 * Salvage package (Closes: #1122647)
* Update build-deps
- Change libcairo-dev to libcairo2-dev (Closes: #1102375)
- Drop libwlroots-0.18-dev which is no longer used (Closes: #1122203)
- Add libgles-dev, libopengl-dev and wayland-protocols (previously
transitive dependencies of wlroots)
- Update versions on hyprutils and hyprlang
* Update maintainer to Debian Hyprland team
* Reindent Build-Depends to match team convention
* Update Vcs-* fields to point to hyprland-team
-- Chow Loong Jin <hyperair@debian.org> Fri, 12 Dec 2025 22:29:57 +0800
hyprpaper (0.7.6-0.1) unstable; urgency=medium
* Non-maintainer upload
* New upstream release 0.7.6 (Closes: #1106522)
- Also fixes FTBFS with cmake 4 (Closes: #1112999)
* Switch libjpeg64-turbo-dev build-dep to libjpeg-dev (Closes: #1090808)
-- Chow Loong Jin <hyperair@debian.org> Mon, 13 Oct 2025 11:17:06 +0800
hyprpaper (0.7.4-1) UNRELEASED; urgency=medium
* New upstream version 0.7.4
-- Alan M Varghese (NyxTrail) <alan@digistorm.in> Sun, 02 Mar 2025 10:32:11 +0000 -- Alan M Varghese (NyxTrail) <alan@digistorm.in> Sun, 02 Mar 2025 10:32:11 +0000
hyprpaper (0.7.1-1) unstable; urgency=medium hyprpaper (0.7.1-1) UNRELEASED; urgency=medium
* New upstream version 0.7.1 * New upstream version 0.7.1
-- Alan M Varghese (NyxTrail) <alan@digistorm.in> Sun, 22 Sep 2024 09:37:04 +0000 -- Alan M Varghese (NyxTrail) <alan@digistorm.in> Sun, 22 Sep 2024 09:37:04 +0000
hyprpaper (0.7.0-1.1) unstable; urgency=medium
* Non-maintainer upload.
* Upgrade to wlroots-0.18. Closes: #1092436
-- Bastian Germann <bage@debian.org> Thu, 17 Apr 2025 16:35:16 +0200
hyprpaper (0.7.0-1) unstable; urgency=low hyprpaper (0.7.0-1) unstable; urgency=low
* Initial release. Closes: #1065699 * Initial release. Closes: #1065699

45
debian/control vendored
View File

@ -1,28 +1,35 @@
Source: hyprpaper Source: hyprpaper
Section: x11 Section: x11
Priority: optional Priority: optional
Maintainer: Alan M Varghese (NyxTrail) <alan@digistorm.in> Maintainer: Debian Hyprland Maintainers <team+hyprland@tracker.debian.org>
Build-Depends: cmake, Uploaders:
debhelper-compat (= 13), Chow Loong Jin <hyperair@debian.org>,
hyprwayland-scanner (>= 0.4.2), Carl Keinath <carl.keinath@gmail.com>,
pkgconf, Alan M Varghese (NyxTrail) <alan@digistorm.in>
libcairo-dev, Build-Depends:
libhyprlang-dev, cmake,
libhyprgraphics-dev (>= 0.1.1), debhelper-compat (= 13),
libhyprutils-dev (>= 0.2.2), hyprwayland-scanner (>= 0.4.2),
libjpeg62-turbo-dev, pkgconf,
libmagic-dev, libcairo2-dev,
libpango1.0-dev, libgles-dev,
libwayland-dev, libhyprlang-dev (>= 0.6.0),
libwebp-dev, libhyprgraphics-dev (>= 0.1.1),
libwlroots-dev, libhyprutils-dev (>= 0.2.4),
ninja-build, libjpeg-dev,
pandoc libmagic-dev,
libopengl-dev,
libpango1.0-dev,
libwayland-dev,
libwebp-dev,
ninja-build,
pandoc,
wayland-protocols (>= 1.35)
Standards-Version: 4.7.0 Standards-Version: 4.7.0
Homepage: https://github.com/hyprwm/hyprpaper Homepage: https://github.com/hyprwm/hyprpaper
Rules-Requires-Root: no Rules-Requires-Root: no
Vcs-Git: https://salsa.debian.org/NyxTrail/hyprpaper.git Vcs-Git: https://salsa.debian.org/hyprland-team/hyprpaper.git
Vcs-Browser: https://salsa.debian.org/NyxTrail/hyprpaper Vcs-Browser: https://salsa.debian.org/hyprland-team/hyprpaper
Package: hyprpaper Package: hyprpaper
Architecture: any Architecture: any

View File

@ -1,4 +0,0 @@
#
# ### gbp-buildpackage(1) user may like this. ###
#abort-on-upstream-changes
#unapply-patches

View File

@ -13,11 +13,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1737634889, "lastModified": 1750621377,
"narHash": "sha256-9JZE3KxcXOqZH9zs3UeadngDiK/yIACTiAR8HSA/TNI=", "narHash": "sha256-8u6b5oAdX0rCuoR8wFenajBRmI+mzbpNig6hSCuWUzE=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprgraphics", "repo": "hyprgraphics",
"rev": "0d77b4895ad5f1bb3b0ee43103a5246c58b65591", "rev": "b3d628d01693fb9bb0a6690cd4e7b80abda04310",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -39,11 +39,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1737634606, "lastModified": 1750371198,
"narHash": "sha256-W7W87Cv6wqZ9PHegI6rH1+ve3zJPiyevMFf0/HwdbCQ=", "narHash": "sha256-/iuJ1paQOBoSLqHflRNNGyroqfF/yvPNurxzcCT0cAE=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprlang", "repo": "hyprlang",
"rev": "f41271d35cc0f370d300413d756c2677f386af9d", "rev": "cee01452bca58d6cadb3224e21e370de8bc20f0b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -62,11 +62,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1737632363, "lastModified": 1750371096,
"narHash": "sha256-X9I8POSlHxBVjD0fiX1O2j7U9Zi1+4rIkrsyHP0uHXY=", "narHash": "sha256-JB1IeJ41y7kWc/dPGV6RMcCUM0Xj2NEK26A2Ap7EM9c=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprutils", "repo": "hyprutils",
"rev": "006620eb29d54ea9086538891404c78563d1bae1", "rev": "38f3a211657ce82a1123bf19402199b67a410f08",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -85,11 +85,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1735493474, "lastModified": 1750371869,
"narHash": "sha256-fktzv4NaqKm94VAkAoVqO/nqQlw+X0/tJJNAeCSfzK4=", "narHash": "sha256-lGk4gLjgZQ/rndUkzmPYcgbHr8gKU5u71vyrjnwfpB4=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprwayland-scanner", "repo": "hyprwayland-scanner",
"rev": "de913476b59ee88685fdc018e77b8f6637a2ae0b", "rev": "aa38edd6e3e277ae6a97ea83a69261a5c3aab9fd",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -100,11 +100,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1737469691, "lastModified": 1750365781,
"narHash": "sha256-nmKOgAU48S41dTPIXAq0AHZSehWUn6ZPrUKijHAMmIk=", "narHash": "sha256-XE/lFNhz5lsriMm/yjXkvSZz5DfvKJLUjsS6pP8EC50=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "9e4d5190a9482a1fb9d18adf0bdb83c6e506eaab", "rev": "08f22084e6085d19bcfb4be30d1ca76ecb96fe54",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -62,7 +62,7 @@
inputs.hyprwayland-scanner.overlays.default inputs.hyprwayland-scanner.overlays.default
(final: prev: rec { (final: prev: rec {
hyprpaper = final.callPackage ./nix/default.nix { hyprpaper = final.callPackage ./nix/default.nix {
stdenv = final.gcc14Stdenv; stdenv = final.gcc15Stdenv;
version = version + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty"); version = version + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
commit = self.rev or ""; commit = self.rev or "";
}; };

View File

@ -3,8 +3,22 @@
#include <fstream> #include <fstream>
#include <signal.h> #include <signal.h>
#include <sys/types.h> #include <sys/types.h>
#include <malloc.h>
#include <unistd.h>
CHyprpaper::CHyprpaper() = default; static void setMallocThreshold() {
#ifdef M_TRIM_THRESHOLD
// The default is 128 pages,
// which is very large and can lead to a lot of memory used for no reason
// because trimming hasn't happened
static const int PAGESIZE = sysconf(_SC_PAGESIZE);
mallopt(M_TRIM_THRESHOLD, 6 * PAGESIZE);
#endif
}
CHyprpaper::CHyprpaper() {
setMallocThreshold();
}
static void handleGlobal(CCWlRegistry* registry, uint32_t name, const char* interface, uint32_t version) { static void handleGlobal(CCWlRegistry* registry, uint32_t name, const char* interface, uint32_t version) {
if (strcmp(interface, wl_compositor_interface.name) == 0) { if (strcmp(interface, wl_compositor_interface.name) == 0) {

View File

@ -176,6 +176,22 @@ static Hyprlang::CParseResult handleReload(const char* C, const char* V) {
return Hyprlang::CParseResult{}; return Hyprlang::CParseResult{};
} }
static Hyprlang::CParseResult handleSource(const char* C, const char* V) {
Hyprlang::CParseResult result;
const std::string path = g_pConfigManager->absolutePath(V);
std::error_code ec;
if (!std::filesystem::exists(path, ec)) {
result.setError((ec ? ec.message() : "no such file").c_str());
return result;
}
g_pConfigManager->config->parseFile(path.c_str());
return result;
}
CConfigManager::CConfigManager() { CConfigManager::CConfigManager() {
// Initialize the configuration // Initialize the configuration
// Read file from default location // Read file from default location
@ -195,6 +211,7 @@ CConfigManager::CConfigManager() {
config->registerHandler(&handlePreload, "preload", {.allowFlags = false}); config->registerHandler(&handlePreload, "preload", {.allowFlags = false});
config->registerHandler(&handleUnloadAll, "unloadAll", {.allowFlags = false}); config->registerHandler(&handleUnloadAll, "unloadAll", {.allowFlags = false});
config->registerHandler(&handleReload, "reload", {.allowFlags = false}); config->registerHandler(&handleReload, "reload", {.allowFlags = false});
config->registerHandler(&handleSource, "source", {.allowFlags = false});
config->commence(); config->commence();
} }
@ -214,7 +231,7 @@ std::string CConfigManager::getMainConfigPath() {
if (paths.first.has_value()) if (paths.first.has_value())
return paths.first.value(); return paths.first.value();
else else
throw std::runtime_error("Could not find config in HOME, XDG_CONFIG_HOME, XDG_CONFIG_DIRS or /etc/hypr."); return "";
} }
// trim from both ends // trim from both ends
@ -227,3 +244,18 @@ std::string CConfigManager::trimPath(std::string path) {
size_t pathEndIndex = path.find_last_not_of(" \t\r\n"); size_t pathEndIndex = path.find_last_not_of(" \t\r\n");
return path.substr(pathStartIndex, pathEndIndex - pathStartIndex + 1); return path.substr(pathStartIndex, pathEndIndex - pathStartIndex + 1);
} }
std::string CConfigManager::absolutePath(const std::string& path) {
if (path.empty())
return "";
std::string result = path;
if (result[0] == '~') {
const char* home = getenv("HOME");
if (home)
result = std::string(home) + result.substr(1);
}
return std::filesystem::absolute(result).string();
}

View File

@ -13,6 +13,7 @@ class CConfigManager {
std::deque<std::string> m_dRequestedPreloads; std::deque<std::string> m_dRequestedPreloads;
std::string getMainConfigPath(); std::string getMainConfigPath();
std::string trimPath(std::string path); std::string trimPath(std::string path);
std::string absolutePath(const std::string& path);
std::unique_ptr<Hyprlang::CConfig> config; std::unique_ptr<Hyprlang::CConfig> config;