Add ags base config
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
15
users/configs/ags/default.nix
Normal file
15
users/configs/ags/default.nix
Normal 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
3
users/configs/ags/src/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
node_modules
|
||||||
|
types
|
||||||
|
bun.lockb
|
24
users/configs/ags/src/default.nix
Normal file
24
users/configs/ags/src/default.nix
Normal 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
|
||||||
|
'';
|
||||||
|
}
|
12
users/configs/ags/src/index.ts
Normal file
12
users/configs/ags/src/index.ts
Normal 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: []
|
||||||
|
})
|
3
users/configs/ags/src/lib.ts
Normal file
3
users/configs/ags/src/lib.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export const range = (length: number, start = 1) => {
|
||||||
|
return Array.from({ length }, (_, i) => i + start)
|
||||||
|
}
|
11
users/configs/ags/src/package.json
Normal file
11
users/configs/ags/src/package.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"name": "ags",
|
||||||
|
"module": "index.ts",
|
||||||
|
"type": "module",
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/bun": "latest"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"typescript": "^5.0.0"
|
||||||
|
}
|
||||||
|
}
|
18
users/configs/ags/src/tsconfig.json
Normal file
18
users/configs/ags/src/tsconfig.json
Normal 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,
|
||||||
|
}
|
||||||
|
}
|
@@ -61,15 +61,6 @@ in
|
|||||||
"$mod_SHIFT, right, movewindow, r"
|
"$mod_SHIFT, right, movewindow, r"
|
||||||
"$mod_SHIFT, l, 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, cyclenext"
|
||||||
"$mod, Tab, bringactivetotop"
|
"$mod, Tab, bringactivetotop"
|
||||||
"$mod_SHIFT, Tab, cyclenext, prev"
|
"$mod_SHIFT, Tab, cyclenext, prev"
|
||||||
@@ -85,6 +76,17 @@ in
|
|||||||
"CTRL_ALT, Delete, exit"
|
"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 = [
|
bindm = [
|
||||||
"$mod, mouse:272, movewindow"
|
"$mod, mouse:272, movewindow"
|
||||||
"$mod, mouse:273, resizewindow"
|
"$mod, mouse:273, resizewindow"
|
||||||
|
@@ -21,6 +21,7 @@
|
|||||||
"editor.smoothScrolling" = true;
|
"editor.smoothScrolling" = true;
|
||||||
"editor.stickyScroll.enabled" = true;
|
"editor.stickyScroll.enabled" = true;
|
||||||
"editor.suggestSelection" = "first";
|
"editor.suggestSelection" = "first";
|
||||||
|
"editor.tabSize" = 2;
|
||||||
"editor.unicodeHighlight.includeComments" = true;
|
"editor.unicodeHighlight.includeComments" = true;
|
||||||
"editor.unicodeHighlight.nonBasicASCII" = true;
|
"editor.unicodeHighlight.nonBasicASCII" = true;
|
||||||
"explorer.confirmDelete" = false;
|
"explorer.confirmDelete" = false;
|
||||||
|
@@ -11,6 +11,7 @@ in
|
|||||||
(import ../configs/firefox { inherit user; })
|
(import ../configs/firefox { inherit user; })
|
||||||
(import ../configs/hyprland { inherit user; })
|
(import ../configs/hyprland { inherit user; })
|
||||||
(import ../configs/hyprshot { inherit user; })
|
(import ../configs/hyprshot { inherit user; })
|
||||||
|
(import ../configs/ags { inherit user; })
|
||||||
(import ../configs/wev { inherit user; })
|
(import ../configs/wev { inherit user; })
|
||||||
(import ../configs/brightnessctl { inherit user; })
|
(import ../configs/brightnessctl { inherit user; })
|
||||||
(import ../configs/pavucontrol { inherit user; })
|
(import ../configs/pavucontrol { inherit user; })
|
||||||
|
Reference in New Issue
Block a user