Compare commits

..

4 commits

9 changed files with 140 additions and 1 deletions

View file

@ -13,6 +13,7 @@ rec {
emmet-cli = pkgs.callPackage ./emmet-cli.nix { }; emmet-cli = pkgs.callPackage ./emmet-cli.nix { };
material-wifi-icons = pkgs.callPackage ./material-wifi-icons.nix { }; material-wifi-icons = pkgs.callPackage ./material-wifi-icons.nix { };
gnome-pass-search-provider = pkgs.callPackage ./gnome-pass-search-provider.nix { }; gnome-pass-search-provider = pkgs.callPackage ./gnome-pass-search-provider.nix { };
gitlab-artifact-cleanup = pkgs.callPackage ./gitlab-artifact-cleanup.nix { };
my-factorio-headless = pkgs.callPackage ./factorio-headless { my-factorio-headless = pkgs.callPackage ./factorio-headless {
inherit (pkgs.unstable) factorio-headless; inherit (pkgs.unstable) factorio-headless;
}; };

View file

@ -0,0 +1,65 @@
{
lib,
python3Packages,
fetchFromGitHub,
}:
let
yacl = python3Packages.buildPythonPackage rec {
pname = "yacl";
version = "0.6.1";
pyproject = true;
src = fetchFromGitHub {
owner = "IngoMeyer441";
repo = "yacl";
rev = "v${version}";
hash = "sha256-W62amvrH8RdWpBhfmj+iVyekuDhr74ueIOzRw6GO2i8=";
};
build-system = with python3Packages; [ setuptools ];
optional-dependencies = {
colored_exceptions = with python3Packages; [ pygments ];
};
pythonImportsCheck = [ "yacl" ];
meta = {
description = "Yet Another Color Logger for Python programs";
homepage = "https://github.com/IngoMeyer441/yacl";
license = lib.licenses.mit;
};
};
in
python3Packages.buildPythonApplication rec {
pname = "gitlab-artifact-cleanup";
version = "0.1.0";
pyproject = true;
src = fetchFromGitHub {
owner = "sciapp";
repo = "gitlab-artifact-cleanup";
rev = "v${version}";
hash = "sha256-xjJyP1z7bAGjTYxFYByeFbFXu/R8908K8upH5fRZnTs=";
};
build-system = with python3Packages; [ setuptools ];
dependencies =
with python3Packages;
[
python-gitlab
yacl
]
++ yacl.optional-dependencies.colored_exceptions;
pythonImportsCheck = [ "gitlab_artifact_cleanup" ];
meta = {
description = "Tool for cleaning up old GitLab CI/CD job artifacts";
homepage = "https://github.com/sciapp/gitlab-artifact-cleanup";
license = lib.licenses.mit;
mainProgram = "gitlab-artifact-cleanup";
};
}

View file

@ -159,6 +159,7 @@
print-battery-icon = [ ]; print-battery-icon = [ ];
controller-battery = [ print-battery-icon ]; controller-battery = [ print-battery-icon ];
mouse-battery = [ print-battery-icon ]; mouse-battery = [ print-battery-icon ];
vrr-fullscreen = [ ];
nix-prefetch-firefox-extension = [ nix-prefetch-firefox-extension = [
nix nix
]; ];

29
scripts/vrr-fullscreen Executable file
View file

@ -0,0 +1,29 @@
#!/usr/bin/env bash
# List of supported outputs for VRR
output_vrr_whitelist=(
"DP-1"
"DP-2"
"DP-3"
)
# Toggle VRR for fullscreened apps in prespecified displays to avoid stutters while in desktop
swaymsg -t subscribe -m '[ "window" ]' | while read window_json; do
window_event=$(echo ${window_json} | jq -r '.change')
# Process only focus change and fullscreen toggle
if [[ $window_event = "focus" || $window_event = "fullscreen_mode" ]]; then
output_json=$(swaymsg -t get_outputs | jq -r '.[] | select(.focused == true)')
output_name=$(echo ${output_json} | jq -r '.name')
# Use only VRR in whitelisted outputs
if [[ ${output_vrr_whitelist[*]} =~ ${output_name} ]]; then
output_vrr_status=$(echo ${output_json} | jq -r '.adaptive_sync_status')
window_fullscreen_status=$(echo ${window_json} | jq -r '.container.fullscreen_mode')
# Only update output if nesseccary to avoid flickering
[[ $output_vrr_status = "disabled" && $window_fullscreen_status = "1" ]] && swaymsg output "${output_name}" adaptive_sync 1
[[ $output_vrr_status = "enabled" && $window_fullscreen_status = "0" ]] && swaymsg output "${output_name}" adaptive_sync 0
fi
fi
done

View file

@ -39,7 +39,13 @@ in
programs.wshowkeys.enable = true; programs.wshowkeys.enable = true;
xdg.portal = { xdg.portal = {
enable = true; enable = true;
wlr.enable = true; wlr = {
enable = true;
settings.screencast = {
chooser_type = "dmenu";
chooser_cmd = lib.getExe pkgs.bmenu;
};
};
# gtk portal needed to make gtk apps happy # gtk portal needed to make gtk apps happy
extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
}; };

View file

@ -22,5 +22,20 @@
kdePackages.partitionmanager kdePackages.partitionmanager
kdePackages.sddm-kcm kdePackages.sddm-kcm
]; ];
xdg.portal = {
enable = true;
extraPortals = [ pkgs.kdePackages.xdg-desktop-portal-kde ];
config = {
common = {
default = [ "kde" ];
};
};
};
environment.sessionVariables = {
GTK_USE_PORTAL = "1";
GDK_DEBUG = "portals";
};
}; };
} }

View file

@ -73,6 +73,8 @@ in
gh gh
glab glab
gitlab-artifact-cleanup
]; ];
}; };
} }

View file

@ -9,4 +9,9 @@
} }
// lib.mkIf (config.my.desktop == "kde") { // lib.mkIf (config.my.desktop == "kde") {
services.gpg-agent.pinentry.package = lib.mkForce pkgs.pinentry-qt; services.gpg-agent.pinentry.package = lib.mkForce pkgs.pinentry-qt;
# Some programs like Firefox and vscode don't use xdg-open, and instead use org.freedesktop.FileManager1.
# This forces Dolphin to be the provider for that.
xdg.dataFile."dbus-1/services/org.freedesktop.FileManager1.service".source =
"${pkgs.kdePackages.dolphin}/share/dbus-1/services/org.kde.dolphin.FileManager1.service";
} }

View file

@ -138,6 +138,21 @@ in
services.gpg-agent.pinentry.package = pkgs.pinentry-all; services.gpg-agent.pinentry.package = pkgs.pinentry-all;
systemd.user.services.vrr-fullscreen = {
Unit = {
Description = "Enable VRR for fullscreen windows";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
Service = {
ExecStart = "${lib.getExe pkgs.vrr-fullscreen}";
Restart = "on-failure";
};
Install = {
WantedBy = [ "sway-session.target" ];
};
};
xdg.configFile."OpenTabletDriver/settings.json" = { xdg.configFile."OpenTabletDriver/settings.json" = {
force = true; force = true;
source = ./open-tablet-driver.json; source = ./open-tablet-driver.json;