Partially add screenshots and media controls

inky
Elnu 2 years ago
parent d8c2703a88
commit 2a8931b112

@ -11,3 +11,8 @@
- Install and setup service for yubioath-desktop
- Install Anthy IME for Japanese input
- Fix issue where wireless connection dies after suspend, even after restarting NetworkManager
- Fix screenshots
- Fix adding screenshots to clipboard with `xclip`
- Could be a system/user level issue? Try installing required packages without home manager
- Get area selection screenshots working in i3 (currently only when manually run)
- Fix/map media keys (already declared within [`i3.nix`](i3.nix) but are non-functional

@ -3,6 +3,13 @@
let
mod = "Mod4";
in {
# Dependencies
home.packages = with pkgs; [
playerctl # pactl comes with PulseAudio
scrot # Screnshot keybindings
xclip # Copying screenshots to clipboard
];
xsession.windowManager.i3 = {
enable = true;
config = {
@ -20,11 +27,24 @@ in {
"${mod}+Return" = "exec kitty";
"${mod}+Shift+e" = "exec i3-msg exit"; # bypass default session exit confirmation menu
"Mod1+Q" = "exec /etc/profiles/per-user/elnu/bin/rofi-power";
# Audio controls
"XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10%";
"XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10%";
"XF86AudioMute" = "exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle";
"XF86AudioMicMute" = "exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle";
};
# Media player controls
"XF86AudioPlay" = "exec playerctl play-pause";
"XF86AudioNext" = "exec playerctl next";
"XF86AudioPrev" = "exec playerctl previous";
# Multi-screen screenshots with scrot
"Print" = "exec scrot 'screenshot_%Y%m%d_%H%M%S.png' -e 'mkdir -p ~/Pictures/screenshots && mv $f ~/Pictures/screenshots && xclip -selection clipboard -t image/png -i ~/Pictures/screenshots/`ls -1 -t ~/Pictures/screenshots | head -1`"; # All screens
# OSX-like area selection screenshots
"Shift+Print" = "exec scrot -s 'screenshot_%Y%m%d_%H%M%S.png' -e 'mkdir -p ~/Pictures/screenshots && mv $f ~/Pictures/screenshots && xclip -selection clipboard -t image/png -i ~/Pictures/screenshots/`ls -1 -t ~/Pictures/screenshots | head -1`'"; # Area selection
};
keycodebindings = {
"133" = "--release exec rofi -show run -theme";
};

Loading…
Cancel
Save