Compare commits
3 Commits
ee29e53f7c
...
fix/waybar
| Author | SHA1 | Date | |
|---|---|---|---|
| c053846adb | |||
| 2edad6c5df | |||
| 1d5acc09c6 |
@@ -233,7 +233,6 @@
|
|||||||
position = "left";
|
position = "left";
|
||||||
order = 10;
|
order = 10;
|
||||||
settings = {
|
settings = {
|
||||||
on-click = "activate";
|
|
||||||
format = "{id} {windows}";
|
format = "{id} {windows}";
|
||||||
format-window-separator = " ";
|
format-window-separator = " ";
|
||||||
window-rewrite-default = util.glyph "f2d0";
|
window-rewrite-default = util.glyph "f2d0";
|
||||||
|
|||||||
@@ -6,37 +6,33 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
# PipeWire as the desktop audio server.
|
# PipeWire as the desktop audio server.
|
||||||
|
let
|
||||||
|
mediaKey = keys: command: {
|
||||||
|
inherit keys;
|
||||||
|
locked = true;
|
||||||
|
action = {
|
||||||
|
kind = "exec";
|
||||||
|
command = "${lib.getExe pkgs.playerctl} ${command}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
{
|
{
|
||||||
options.modules.desktop.utilities.audio.enable = lib.mkEnableOption "the PipeWire audio server";
|
options.modules.desktop.utilities.audio.enable = lib.mkEnableOption "the PipeWire audio server";
|
||||||
|
|
||||||
config = lib.mkIf config.modules.desktop.utilities.audio.enable {
|
config = lib.mkIf config.modules.desktop.utilities.audio.enable {
|
||||||
|
# Realtime scheduling for the audio threads, so playback survives load.
|
||||||
|
security.rtkit.enable = true;
|
||||||
|
|
||||||
|
services.pipewire = {
|
||||||
|
enable = true;
|
||||||
|
alsa.enable = true;
|
||||||
|
pulse.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
registry.keybind.${config.networking.hostName} = {
|
registry.keybind.${config.networking.hostName} = {
|
||||||
media-play = {
|
media-play = mediaKey "XF86AudioPlay" "play-pause";
|
||||||
keys = "XF86AudioPlay";
|
media-next = mediaKey "XF86AudioNext" "next";
|
||||||
locked = true;
|
media-previous = mediaKey "XF86AudioPrev" "previous";
|
||||||
action = {
|
|
||||||
kind = "exec";
|
|
||||||
command = "${lib.getExe pkgs.playerctl} play-pause";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
media-next = {
|
|
||||||
keys = "XF86AudioNext";
|
|
||||||
locked = true;
|
|
||||||
action = {
|
|
||||||
kind = "exec";
|
|
||||||
command = "${lib.getExe pkgs.playerctl} next";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
media-previous = {
|
|
||||||
keys = "XF86AudioPrev";
|
|
||||||
locked = true;
|
|
||||||
action = {
|
|
||||||
kind = "exec";
|
|
||||||
command = "${lib.getExe pkgs.playerctl} previous";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
registry.waybar.${config.networking.hostName} = {
|
registry.waybar.${config.networking.hostName} = {
|
||||||
@@ -66,14 +62,5 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Realtime scheduling for the audio threads, so playback survives load.
|
|
||||||
security.rtkit.enable = true;
|
|
||||||
|
|
||||||
services.pipewire = {
|
|
||||||
enable = true;
|
|
||||||
alsa.enable = true;
|
|
||||||
pulse.enable = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,21 +6,15 @@
|
|||||||
}:
|
}:
|
||||||
# Clipboard history: cliphist records every copy, picked back through rofi.
|
# Clipboard history: cliphist records every copy, picked back through rofi.
|
||||||
let
|
let
|
||||||
user = config.user.name;
|
|
||||||
|
|
||||||
cliphist = "${pkgs.cliphist}/bin/cliphist";
|
|
||||||
rofi = "${pkgs.rofi}/bin/rofi";
|
|
||||||
wl-copy = "${pkgs.wl-clipboard}/bin/wl-copy";
|
|
||||||
|
|
||||||
# The picker reuses the themed rofi, so history looks like every other menu
|
# The picker reuses the themed rofi, so history looks like every other menu
|
||||||
# the launcher drives.
|
# the launcher drives.
|
||||||
# decode is needed because list emits id-prefixed lines rather than the copied
|
# decode is needed because list emits id-prefixed lines rather than the copied
|
||||||
# bytes, so the chosen id has to be resolved back before it can be re-copied.
|
# bytes, so the chosen id has to be resolved back before it can be re-copied.
|
||||||
picker = pkgs.writeShellScript "clipboard-picker" ''
|
picker = pkgs.writeShellScript "clipboard-picker" ''
|
||||||
${cliphist} list \
|
${lib.getExe pkgs.cliphist} list \
|
||||||
| ${rofi} -dmenu -i -p Clipboard \
|
| ${lib.getExe pkgs.rofi} -dmenu -i -p Clipboard \
|
||||||
| ${cliphist} decode \
|
| ${lib.getExe pkgs.cliphist} decode \
|
||||||
| ${wl-copy}
|
| ${lib.getExe' pkgs.wl-clipboard "wl-copy"}
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
@@ -28,15 +22,7 @@ in
|
|||||||
lib.mkEnableOption "cliphist clipboard history";
|
lib.mkEnableOption "cliphist clipboard history";
|
||||||
|
|
||||||
config = lib.mkIf config.modules.desktop.utilities.clipboard.enable {
|
config = lib.mkIf config.modules.desktop.utilities.clipboard.enable {
|
||||||
registry.keybind.${config.networking.hostName}.clipboard-history = {
|
home-manager.users.${config.user.name} = {
|
||||||
keys = "SUPER + SHIFT + V";
|
|
||||||
action = {
|
|
||||||
kind = "exec";
|
|
||||||
command = "${picker}";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
home-manager.users.${user} = {
|
|
||||||
# wl-copy and wl-paste on PATH, so the shell can pipe into and out of the
|
# wl-copy and wl-paste on PATH, so the shell can pipe into and out of the
|
||||||
# clipboard.
|
# clipboard.
|
||||||
# The watchers and picker above reach wl-clipboard by store path, so this
|
# The watchers and picker above reach wl-clipboard by store path, so this
|
||||||
@@ -47,5 +33,13 @@ in
|
|||||||
# session so uwsm starts and stops them with it.
|
# session so uwsm starts and stops them with it.
|
||||||
services.cliphist.enable = true;
|
services.cliphist.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
registry.keybind.${config.networking.hostName}.clipboard-history = {
|
||||||
|
keys = "SUPER + SHIFT + V";
|
||||||
|
action = {
|
||||||
|
kind = "exec";
|
||||||
|
command = "${picker}";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user