Compare commits

...

5 Commits

Author SHA1 Message Date
LordMZTE 28134cfe4e
rename confgen subcommand 2024-03-09 21:32:03 +01:00
LordMZTE 81673f78ae use env for setup script 2024-03-09 21:11:51 +01:00
LordMZTE fa9f05fac5
add nix dev shell 2024-03-09 21:10:03 +01:00
LordMZTE acde8fb7be
mzteinit: update to latest Zig 2024-03-09 19:37:52 +01:00
LordMZTE 365c7b2ff1
mzteriver: touchpad config 2024-03-08 23:27:50 +01:00
6 changed files with 107 additions and 10 deletions

61
flake.lock Normal file
View File

@ -0,0 +1,61 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1709703039,
"narHash": "sha256-6hqgQ8OK6gsMu1VtcGKBxKQInRLHtzulDo9Z5jxHEFY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9df3e30ce24fd28c7b3e2de0d986769db5d6225d",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"utils": "utils"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1709126324,
"narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "d465f4819400de7c8d874d50b982301f28a84605",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View File

@ -21,5 +21,30 @@
(flakePkg "github:nix-community/zon2nix")
];
};
devShells.default = nixpkgs.legacyPackages.${system}.mkShell {
buildInputs = with pkgs; [
# packages required to build scripts
# TODO: build scripts with nix instead
pkg-config
wayland
wayland-protocols
libgit2
libGL
roswell
] ++
# shorthands for setup.rkt
builtins.map
(cmd: pkgs.writeShellScriptBin cmd ''
./setup.rkt ${cmd}
'') [
"install-scripts"
"install-plugins"
"install-lsps-paru"
"setup-nvim-config"
"setup-nix"
"run-confgen"
];
};
});
}

View File

@ -8,14 +8,16 @@ const log = std.log.scoped(.server);
alloc: std.mem.Allocator,
env: *Mutex(std.process.EnvMap),
ss: std.net.StreamServer,
ss: std.net.Server,
const Server = @This();
pub fn init(alloc: std.mem.Allocator, sockpath: []const u8, env: *Mutex(std.process.EnvMap)) !Server {
var ss = std.net.StreamServer.init(.{});
try ss.listen(try std.net.Address.initUnix(sockpath));
return .{ .alloc = alloc, .ss = ss, .env = env };
return .{
.alloc = alloc,
.ss = try (try std.net.Address.initUnix(sockpath)).listen(.{}),
.env = env,
};
}
pub fn run(self: *Server) !void {
@ -26,7 +28,7 @@ pub fn run(self: *Server) !void {
}
}
pub fn handleConnection(self: *Server, con: std.net.StreamServer.Connection) !void {
pub fn handleConnection(self: *Server, con: std.net.Server.Connection) !void {
defer con.stream.close();
while (true) {
const msg = message.Serverbound.read(con.stream.reader(), self.alloc) catch |e| {

View File

@ -110,6 +110,15 @@ pub fn init(alloc: std.mem.Allocator) !void {
try con.runCommand(&.{ "map-pointer", "normal", "Super", "BTN_LEFT", "move-view" });
try con.runCommand(&.{ "map-pointer", "normal", "Super", "BTN_RIGHT", "resize-view" });
// touchpad config
inline for (.{
.{ "click-method", "clickfinger" },
.{ "tap-button-map", "left-right-middle" },
.{ "tap", "enabled" },
}) |cmd| {
try con.runCommand(&[_][:0]const u8{ "input", "*" } ++ cmd);
}
// tag config
for (0..9) |i| {
var key_buf: [16]u8 = undefined;

View File

@ -1,4 +1,4 @@
#!/usr/bin/racket
#!/usr/bin/env racket
#lang racket
;; Script for setting up the config.
@ -7,12 +7,12 @@
"setup/common.rkt")
;; Valid verbs
(define verbs '(install-scripts install-plugins install-lsps-paru setup-nvim-config setup-nix confgen))
(define verbs '(install-scripts install-plugins install-lsps-paru setup-nvim-config setup-nix run-confgen))
(define verb
(command-line #:program "setup.rkt"
#:usage-help "Sets up my dotfiles. Available verbs:"
"install-scripts, install-plugins, install-lsps-paru, setup-nvim-config, confgen"
"install-scripts, install-plugins, install-lsps-paru, setup-nvim-config, run-confgen"
#:once-each
[("-o" "--bin-output") o "Output directory for executables" (output-bin-path o)]
#:args (verb)
@ -50,6 +50,6 @@
['setup-nix
(local-require "setup/commands/setup-nix.rkt")
(run)]
['confgen
(local-require "setup/commands/confgen.rkt")
['run-confgen
(local-require "setup/commands/run-confgen.rkt")
(run)])