Add ags base config

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-06-29 13:49:24 +03:00
parent e89758467a
commit 8990c661ac
10 changed files with 99 additions and 9 deletions

View File

@@ -0,0 +1,15 @@
{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }:
let
agsConfig = (import ./src { inherit pkgs; });
in
{
home-manager.users."${user.name}" = {
home.packages = with pkgs; [ ags ];
xdg.configFile.ags = {
source = "${agsConfig}/share/config.js";
target = "ags/config.js";
};
};
}

3
users/configs/ags/src/.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
node_modules
types
bun.lockb

View File

@@ -0,0 +1,24 @@
{ pkgs ? import <nixpkgs> { }, ... }:
pkgs.stdenv.mkDerivation {
name = "ags-config";
src = ./.;
nativeBuildInputs = with pkgs; [ bun ];
phases = [
"buildPhase"
"installPhase"
];
buildPhase = ''
bun build $src/index.ts --outfile=index.js \
--external="file://$src/*" \
--external="gi://*"
'';
installPhase = ''
mkdir -p $out/share
cp index.js $out/share/config.js
'';
}

View File

@@ -0,0 +1,12 @@
import Gtk from "gi://Gtk?version=3.0"
import Gdk from "gi://Gdk"
import { range } from "./lib";
const forMonitors = (widget: (monitor: number) => Gtk.Window) => {
const n = Gdk.Display.get_default()?.get_n_monitors() || 1;
return range(n, 0).flatMap(widget)
}
App.config({
windows: []
})

View File

@@ -0,0 +1,3 @@
export const range = (length: number, start = 1) => {
return Array.from({ length }, (_, i) => i + start)
}

View File

@@ -0,0 +1,11 @@
{
"name": "ags",
"module": "index.ts",
"type": "module",
"devDependencies": {
"@types/bun": "latest"
},
"peerDependencies": {
"typescript": "^5.0.0"
}
}

View File

@@ -0,0 +1,18 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "ES2022",
"lib": [
"ES2022"
],
"allowJs": true,
"checkJs": true,
"strict": true,
"noImplicitAny": false,
"baseUrl": ".",
"typeRoots": [
"./types",
],
"skipLibCheck": true,
}
}

View File

@@ -61,15 +61,6 @@ in
"$mod_SHIFT, right, movewindow, r"
"$mod_SHIFT, l, movewindow, r"
"$mod_CTRL, left, resizeactive, -20 0"
"$mod_CTRL, h, resizeactive, -20 0"
"$mod_CTRL, down, resizeactive, 0 20"
"$mod_CTRL, j, resizeactive, 0 20"
"$mod_CTRL, up, resizeactive, 0 -20"
"$mod_CTRL, k, resizeactive, 0 -20"
"$mod_CTRL, right, resizeactive, 20 0"
"$mod_CTRL, l, resizeactive, 20 0"
"$mod, Tab, cyclenext"
"$mod, Tab, bringactivetotop"
"$mod_SHIFT, Tab, cyclenext, prev"
@@ -85,6 +76,17 @@ in
"CTRL_ALT, Delete, exit"
];
binde = [
"$mod_CTRL, left, resizeactive, -20 0"
"$mod_CTRL, h, resizeactive, -20 0"
"$mod_CTRL, down, resizeactive, 0 20"
"$mod_CTRL, j, resizeactive, 0 20"
"$mod_CTRL, up, resizeactive, 0 -20"
"$mod_CTRL, k, resizeactive, 0 -20"
"$mod_CTRL, right, resizeactive, 20 0"
"$mod_CTRL, l, resizeactive, 20 0"
];
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"

View File

@@ -21,6 +21,7 @@
"editor.smoothScrolling" = true;
"editor.stickyScroll.enabled" = true;
"editor.suggestSelection" = "first";
"editor.tabSize" = 2;
"editor.unicodeHighlight.includeComments" = true;
"editor.unicodeHighlight.nonBasicASCII" = true;
"explorer.confirmDelete" = false;

View File

@@ -11,6 +11,7 @@ in
(import ../configs/firefox { inherit user; })
(import ../configs/hyprland { inherit user; })
(import ../configs/hyprshot { inherit user; })
(import ../configs/ags { inherit user; })
(import ../configs/wev { inherit user; })
(import ../configs/brightnessctl { inherit user; })
(import ../configs/pavucontrol { inherit user; })