Compare commits

...

2 Commits

Author SHA1 Message Date
6b5270d843
fix(nix/host/orion): properly enable graphics acceleration
Some checks failed
Check Formatting of Files / Check-Formatting (push) Failing after 1m4s
2024-06-22 05:50:43 -05:00
f980f035c0
refactor(hypr): use screen-cap as a nix package 2024-06-22 05:50:05 -05:00
6 changed files with 31 additions and 15 deletions

View File

@ -26,6 +26,13 @@
];
};
};
hardware.graphics.enable = true;
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver
intel-vaapi-driver
libvdpau
];
};
services.spice-vdagentd.enable = true;
}

View File

@ -4,6 +4,7 @@
rustPlatform = pkgs.rustPlatform;
fetchFromGitHub = pkgs.fetchFromGitHub;
};
screen-cap = pkgs.callPackage ./screen-cap/default.nix { };
Fmt = pkgs.writeShellApplication {
name = "Fmt";
runtimeInputs = with pkgs; [

View File

@ -0,0 +1,17 @@
{ pkgs }:
pkgs.writeShellApplication {
name = "screen-cap";
runtimeInputs = with pkgs; [
wl-screenrec
gifski
inotify-tools
libnotify
mktemp
slurp
file
];
text = ''
#!${pkgs.bash}/bin/bash
${builtins.readFile ./screen-cap.bash}
'';
}

View File

@ -1,14 +1,4 @@
#!/usr/bin/env -S nix shell github:nix-community/nixgl#nixGLIntel nixpkgs#bash nixpkgs#wl-screenrec nixpkgs#gifski nixpkgs#inotify-tools nixpkgs#libnotify nixpkgs#mktemp nixpkgs#slurp nixpkgs#slurp --command bash
# Dependencies:
# - wl-screenrec: https://github.com/russelltg/wl-screenrec
# - notification daemon: https://archlinux.org/packages/?name=notification-daemon
# - wl-clipboard: https://github.com/bugaevc/wl-clipboard
# - gifski: https://github.com/sindresorhus/Gifski
#
# Gifski is necessary because `wl-screenrec` doesn't support gifs
# set -euoE pipefail
set -euoE pipefail
mk-screen-cap() {
local program_name="Screen Capture"
@ -40,7 +30,7 @@ mk-screen-cap() {
local geometry
geometry="$(slurp)"
nixGLIntel wl-screenrec --filename "$tmp_file" --geometry "$geometry" &
wl-screenrec --filename "$tmp_file" --geometry "$geometry" &
local pid="${!}"
printf "%s" "$pid" >"$pid_file"
printf "Putting pid: '%d' into pid file: '%s'\n" "$pid" "$pid_file"

View File

@ -74,8 +74,8 @@ bind = SUPERSHIFT,M,exit
# May be videos or screenshots
bind = SUPER,S,exec,grim -g "$(slurp)" - | swappy -f - -o - | wl-copy
bind = CTRLSUPER,S,exec,grim -g "$(slurp)" - | wl-copy --type image/png
bind = SUPERSHIFT,S,exec,~/.config/hypr/scripts/screen-cap.bash
bind = SUPERSHIFT,A,exec,~/.config/hypr/scripts/screen-cap.bash gif
bind = SUPERSHIFT,S,exec,screen-cap
bind = SUPERSHIFT,A,exec,screen-cap gif
# Mediakey bindings as taken from `wev`
bindl = ,XF86AudioPrev,exec,playerctl previous

View File

@ -47,6 +47,7 @@ in
slurp
unzip
Fmt
screen-cap
starship
nodePackages.prettier
cargo