mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-05-20 07:53:56 +02:00
Compare commits
5 commits
6a7bf0c300
...
28134cfe4e
Author | SHA1 | Date | |
---|---|---|---|
LordMZTE | 28134cfe4e | ||
LordMZTE | 81673f78ae | ||
LordMZTE | fa9f05fac5 | ||
LordMZTE | acde8fb7be | ||
LordMZTE | 365c7b2ff1 |
61
flake.lock
Normal file
61
flake.lock
Normal 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
|
||||||
|
}
|
25
flake.nix
25
flake.nix
|
@ -21,5 +21,30 @@
|
||||||
(flakePkg "github:nix-community/zon2nix")
|
(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"
|
||||||
|
];
|
||||||
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,14 +8,16 @@ const log = std.log.scoped(.server);
|
||||||
|
|
||||||
alloc: std.mem.Allocator,
|
alloc: std.mem.Allocator,
|
||||||
env: *Mutex(std.process.EnvMap),
|
env: *Mutex(std.process.EnvMap),
|
||||||
ss: std.net.StreamServer,
|
ss: std.net.Server,
|
||||||
|
|
||||||
const Server = @This();
|
const Server = @This();
|
||||||
|
|
||||||
pub fn init(alloc: std.mem.Allocator, sockpath: []const u8, env: *Mutex(std.process.EnvMap)) !Server {
|
pub fn init(alloc: std.mem.Allocator, sockpath: []const u8, env: *Mutex(std.process.EnvMap)) !Server {
|
||||||
var ss = std.net.StreamServer.init(.{});
|
return .{
|
||||||
try ss.listen(try std.net.Address.initUnix(sockpath));
|
.alloc = alloc,
|
||||||
return .{ .alloc = alloc, .ss = ss, .env = env };
|
.ss = try (try std.net.Address.initUnix(sockpath)).listen(.{}),
|
||||||
|
.env = env,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn run(self: *Server) !void {
|
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();
|
defer con.stream.close();
|
||||||
while (true) {
|
while (true) {
|
||||||
const msg = message.Serverbound.read(con.stream.reader(), self.alloc) catch |e| {
|
const msg = message.Serverbound.read(con.stream.reader(), self.alloc) catch |e| {
|
||||||
|
|
|
@ -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_LEFT", "move-view" });
|
||||||
try con.runCommand(&.{ "map-pointer", "normal", "Super", "BTN_RIGHT", "resize-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
|
// tag config
|
||||||
for (0..9) |i| {
|
for (0..9) |i| {
|
||||||
var key_buf: [16]u8 = undefined;
|
var key_buf: [16]u8 = undefined;
|
||||||
|
|
10
setup.rkt
10
setup.rkt
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/racket
|
#!/usr/bin/env racket
|
||||||
#lang racket
|
#lang racket
|
||||||
|
|
||||||
;; Script for setting up the config.
|
;; Script for setting up the config.
|
||||||
|
@ -7,12 +7,12 @@
|
||||||
"setup/common.rkt")
|
"setup/common.rkt")
|
||||||
|
|
||||||
;; Valid verbs
|
;; 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
|
(define verb
|
||||||
(command-line #:program "setup.rkt"
|
(command-line #:program "setup.rkt"
|
||||||
#:usage-help "Sets up my dotfiles. Available verbs:"
|
#: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
|
#:once-each
|
||||||
[("-o" "--bin-output") o "Output directory for executables" (output-bin-path o)]
|
[("-o" "--bin-output") o "Output directory for executables" (output-bin-path o)]
|
||||||
#:args (verb)
|
#:args (verb)
|
||||||
|
@ -50,6 +50,6 @@
|
||||||
['setup-nix
|
['setup-nix
|
||||||
(local-require "setup/commands/setup-nix.rkt")
|
(local-require "setup/commands/setup-nix.rkt")
|
||||||
(run)]
|
(run)]
|
||||||
['confgen
|
['run-confgen
|
||||||
(local-require "setup/commands/confgen.rkt")
|
(local-require "setup/commands/run-confgen.rkt")
|
||||||
(run)])
|
(run)])
|
||||||
|
|
Loading…
Reference in a new issue