2023-11-30 17:17:34 -05:00
|
|
|
{
|
|
|
|
ags,
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: let
|
2024-01-17 19:18:41 -05:00
|
|
|
inherit (config.vars) mainUser hostName;
|
2024-02-05 09:56:42 -05:00
|
|
|
|
2023-11-30 17:17:34 -05:00
|
|
|
isTouchscreen = config.hardware.sensor.iio.enable;
|
|
|
|
in {
|
|
|
|
services.upower.enable = true;
|
|
|
|
|
2024-01-09 13:13:04 -05:00
|
|
|
home-manager.users.${mainUser}.imports = [
|
2023-11-30 17:17:34 -05:00
|
|
|
ags.homeManagerModules.default
|
|
|
|
|
|
|
|
({
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
symlink = config.lib.file.mkOutOfStoreSymlink;
|
2024-02-05 10:37:56 -05:00
|
|
|
inherit (lib) optionals;
|
2024-02-25 10:38:26 -05:00
|
|
|
|
|
|
|
# https://github.com/Aylur/ags/blob/e1f2d311ceb496a69ef6daa6aebb46ce511b2f22/nix/hm-module.nix#L69
|
|
|
|
agsTypes = config.home.file.".local//share/com.github.Aylur.ags/types";
|
2024-02-26 16:28:54 -05:00
|
|
|
agsConfigDir = ".nix/modules/ags/config";
|
2023-11-30 17:17:34 -05:00
|
|
|
in {
|
2024-01-27 14:44:50 -05:00
|
|
|
programs.ags.enable = true;
|
2023-11-30 17:17:34 -05:00
|
|
|
|
2024-01-17 19:18:41 -05:00
|
|
|
home = {
|
|
|
|
file = {
|
2024-01-27 14:44:50 -05:00
|
|
|
".config/ags".source = symlink /home/${mainUser}/.nix/modules/ags/config;
|
2024-02-26 16:28:54 -05:00
|
|
|
|
|
|
|
# Icons
|
|
|
|
"${agsConfigDir}/icons/mouse-razer-symbolic.svg".source = pkgs.fetchurl {
|
2024-02-25 12:10:05 -05:00
|
|
|
url = "https://raw.githubusercontent.com/bithatch/razer-icon-font/main/src/devices/mouse.svg";
|
|
|
|
hash = "sha256-A1+eIp2VEFDyY23GIHKhbnByHXrnVS3QgIJ9sjjtuZw=";
|
|
|
|
};
|
2024-02-26 16:28:54 -05:00
|
|
|
"${agsConfigDir}/icons/down-large-symbolic.svg".source = pkgs.fetchurl {
|
|
|
|
url = "https://www.svgrepo.com/download/158537/down-chevron.svg";
|
|
|
|
hash = "sha256-mOfNjgZh0rt6XosKA2kpLY22lJldSS1XCphgrnvZH1s=";
|
|
|
|
};
|
|
|
|
|
|
|
|
"${agsConfigDir}/types".source = agsTypes.source;
|
|
|
|
"${agsConfigDir}/config.js".text =
|
2024-01-17 19:18:41 -05:00
|
|
|
/*
|
|
|
|
javascript
|
|
|
|
*/
|
|
|
|
''
|
|
|
|
import { transpileTypeScript } from './js/utils.js';
|
2023-11-30 17:17:34 -05:00
|
|
|
|
2024-01-18 09:41:57 -05:00
|
|
|
export default (await transpileTypeScript('${hostName}')).default;
|
2024-01-17 19:18:41 -05:00
|
|
|
'';
|
|
|
|
};
|
2024-01-14 20:52:30 -05:00
|
|
|
|
2024-01-17 19:18:41 -05:00
|
|
|
packages =
|
|
|
|
[config.customPkgs.coloryou]
|
|
|
|
++ (with pkgs; [
|
|
|
|
# ags
|
|
|
|
sassc
|
|
|
|
bun
|
|
|
|
playerctl
|
2024-01-14 20:52:30 -05:00
|
|
|
|
2024-01-17 19:18:41 -05:00
|
|
|
## gui
|
|
|
|
pavucontrol # TODO: replace with ags widget
|
|
|
|
])
|
|
|
|
++ (optionals isTouchscreen (with pkgs; [
|
|
|
|
lisgd
|
|
|
|
squeekboard
|
|
|
|
ydotool
|
|
|
|
]));
|
|
|
|
};
|
2024-02-05 09:56:42 -05:00
|
|
|
|
|
|
|
wayland.windowManager.hyprland = {
|
|
|
|
settings = {
|
2024-02-05 10:37:56 -05:00
|
|
|
exec-once =
|
|
|
|
[
|
|
|
|
"ags"
|
|
|
|
"sleep 3; ags -r 'App.openWindow(\"applauncher\")'"
|
|
|
|
]
|
|
|
|
++ optionals isTouchscreen ["squeekboard"];
|
2024-02-05 09:56:42 -05:00
|
|
|
|
|
|
|
bind = [
|
|
|
|
"$mainMod SHIFT, E , exec, ags -t powermenu"
|
|
|
|
"$mainMod , D , exec, ags -t applauncher"
|
|
|
|
];
|
|
|
|
binde = [
|
|
|
|
## Brightness control
|
2024-02-26 16:28:54 -05:00
|
|
|
", XF86MonBrightnessUp, exec, ags -r 'Brightness.screen += 0.05'"
|
2024-02-05 09:56:42 -05:00
|
|
|
", XF86MonBrightnessDown, exec, ags -r 'Brightness.screen -= 0.05'"
|
|
|
|
];
|
2024-02-26 16:28:54 -05:00
|
|
|
bindn = [",Escape, exec, ags run-js 'closeAll()'"];
|
2024-02-05 09:56:42 -05:00
|
|
|
bindr = ["CAPS, Caps_Lock, exec, ags -r 'Brightness.fetchCapsState()'"];
|
|
|
|
};
|
|
|
|
};
|
2023-11-30 17:17:34 -05:00
|
|
|
})
|
|
|
|
];
|
|
|
|
}
|