refactor: complete rewrite
This commit is contained in:
parent
19a4bbda3c
commit
8e81943cf9
399 changed files with 3396 additions and 8042 deletions
12
modules/home/workstation/tools/1password.nix
Normal file
12
modules/home/workstation/tools/1password.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
osConfig,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
cfg = osConfig.programs._1password;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
ooknet.binds.password = "1password";
|
||||
};
|
||||
}
|
||||
9
modules/home/workstation/tools/default.nix
Normal file
9
modules/home/workstation/tools/default.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
imports = [
|
||||
./ookpower.nix
|
||||
./1password.nix
|
||||
./ookvolume.nix
|
||||
./kdeconnect.nix
|
||||
./ookbrightness.nix
|
||||
];
|
||||
}
|
||||
15
modules/home/workstation/tools/kdeconnect.nix
Normal file
15
modules/home/workstation/tools/kdeconnect.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
lib,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
cfg = osConfig.programs.kdeconnect;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
services.kdeconnect = {
|
||||
enable = true;
|
||||
indicator = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
50
modules/home/workstation/tools/ookbrightness.nix
Normal file
50
modules/home/workstation/tools/ookbrightness.nix
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
lib,
|
||||
osConfig,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
inherit (builtins) elem;
|
||||
inherit (osConfig.ooknet.hardware) features;
|
||||
ookbrightness = pkgs.writeShellApplication {
|
||||
name = "ookbrightness";
|
||||
runtimeInputs = with pkgs; [brillo libnotify];
|
||||
text =
|
||||
/*
|
||||
bash
|
||||
*/
|
||||
''
|
||||
BRIGHTNESS=$(brillo -G | awk -F'.' '{print$1}')
|
||||
notify() {
|
||||
notify-send --app-name="system-notify" -h string:x-canonical-private-synchronous:sys-notify " $BRIGHTNESS%"
|
||||
}
|
||||
option() {
|
||||
case "$1" in
|
||||
up)
|
||||
brillo -q -u 30000 -A 5
|
||||
;;
|
||||
down)
|
||||
brillo -q -u 30000 -U 5
|
||||
;;
|
||||
*)
|
||||
echo "Invalid argument"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
main() {
|
||||
option "$@"
|
||||
notify
|
||||
}
|
||||
main "$@"
|
||||
'';
|
||||
};
|
||||
in {
|
||||
config = mkIf (elem "backlight" features) {
|
||||
home.packages = [ookbrightness];
|
||||
ooknet.binds.brightness = {
|
||||
up = "ookbrightness up";
|
||||
down = "ookbrightness down";
|
||||
};
|
||||
};
|
||||
}
|
||||
14
modules/home/workstation/tools/ookpower.nix
Normal file
14
modules/home/workstation/tools/ookpower.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
inputs',
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
inherit (config.programs) rofi;
|
||||
in {
|
||||
config = mkIf rofi.enable {
|
||||
home.packages = [inputs'.ooks-scripts.packages.powermenu];
|
||||
ooknet.binds.powerMenu = "powermenu -c dmenu";
|
||||
};
|
||||
}
|
||||
48
modules/home/workstation/tools/ookvolume.nix
Normal file
48
modules/home/workstation/tools/ookvolume.nix
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
inherit (builtins) elem;
|
||||
inherit (osConfig.ooknet.hardware) features;
|
||||
ookvolume = pkgs.writeShellApplication {
|
||||
name = "ookvolume";
|
||||
runtimeInputs = with pkgs; [pamixer libnotify];
|
||||
text = ''
|
||||
notify() {
|
||||
volume=$(pamixer --get-volume-human)
|
||||
notify-send --app-name="system-notify" -h string:x-canonical-private-synchronous:sys-notify " $volume"
|
||||
}
|
||||
option() {
|
||||
case "$1" in
|
||||
up)
|
||||
pamixer --increase 5
|
||||
;;
|
||||
down)
|
||||
pamixer --decrease 5
|
||||
;;
|
||||
mute)
|
||||
pamixer --toggle-mute
|
||||
;;
|
||||
*) echo "Invalid option" ;;
|
||||
esac
|
||||
}
|
||||
main() {
|
||||
option "$@"
|
||||
notify
|
||||
}
|
||||
main "$@"
|
||||
'';
|
||||
};
|
||||
in {
|
||||
config = mkIf (elem "audio" features) {
|
||||
home.packages = [ookvolume];
|
||||
ooknet.binds.volume = {
|
||||
up = "ookvolume up";
|
||||
down = "ookvolume down";
|
||||
mute = "ookvolume mute";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue