mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-11-11 20:43:00 +01:00
add backlight control keybinds
This commit is contained in:
parent
a364d99b55
commit
f061a1b3b5
9 changed files with 24 additions and 9 deletions
|
@ -8,6 +8,10 @@ bind = ,XF86AudioStop, exec, <% opt.commands.media.stop %>
|
|||
bind = ,XF86AudioNext, exec, <% opt.commands.media.next %>
|
||||
bind = ,XF86AudioPrev, exec, <% opt.commands.media.prev %>
|
||||
|
||||
# Backlight keys
|
||||
bind = ,XF86MonBrightnessUp, exec, <% opt.commands.backlight_up %>
|
||||
bind = ,XF86MonBrightnessDown, exec, <% opt.commands.backlight_down %>
|
||||
|
||||
# Control keys
|
||||
bind = SUPER SHIFT, E, exit,
|
||||
bind = SUPER SHIFT, Q, killactive,
|
||||
|
|
|
@ -26,17 +26,21 @@ exec --no-startup-id nm-applet
|
|||
# layout manager
|
||||
exec --no-startup-id i3man
|
||||
|
||||
# media keys
|
||||
bindsym XF86AudioRaiseVolume exec <% opt.commands.media.volume_up %>
|
||||
bindsym XF86AudioLowerVolume exec <% opt.commands.media.volume_down %>
|
||||
bindsym XF86AudioMute exec <% opt.commands.media.mute_sink %>
|
||||
bindsym XF86AudioMicMute exec <% opt.commands.media.mute_source %>
|
||||
|
||||
# media keys
|
||||
bindsym XF86AudioPlay exec <% opt.commands.media.play_pause %>
|
||||
bindsym XF86AudioStop exec <% opt.commands.media.stop %>
|
||||
bindsym XF86AudioNext exec <% opt.commands.media.next %>
|
||||
bindsym XF86AudioPrev exec <% opt.commands.media.prev %>
|
||||
|
||||
# Backlight keys
|
||||
bindsym XF86MonBrightnessUp exec <% opt.commands.backlight_up %>
|
||||
bindsym XF86MonBrightnessDown exec <% opt.commands.backlight_down %>
|
||||
|
||||
# other fancy keys
|
||||
bindsym XF86Mail exec <% opt.commands.email %>
|
||||
bindsym XF86Calculator exec <% opt.commands.calculator %>
|
||||
|
|
|
@ -77,6 +77,8 @@ opts.commands = {
|
|||
next = "playerctl next",
|
||||
prev = "playerctl previous",
|
||||
},
|
||||
backlight_up = "light -A 15";
|
||||
backlight_down = "light -U 15";
|
||||
}
|
||||
|
||||
opts.gamemode = {
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1718318537,
|
||||
"narHash": "sha256-4Zu0RYRcAY/VWuu6awwq4opuiD//ahpc2aFHg2CWqFY=",
|
||||
"lastModified": 1719506693,
|
||||
"narHash": "sha256-C8e9S7RzshSdHB7L+v9I51af1gDM5unhJ2xO1ywxNH8=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "e9ee548d90ff586a6471b4ae80ae9cfcbceb3420",
|
||||
"rev": "b2852eb9365c6de48ffb0dc2c9562591f652242a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
wayland-protocols
|
||||
haxe
|
||||
mpv-unwrapped
|
||||
zig_0_12
|
||||
zig_0_13
|
||||
] ++
|
||||
# shorthands for setup.rkt
|
||||
builtins.map
|
||||
|
|
|
@ -12,7 +12,7 @@ pub fn build(b: *std.Build) void {
|
|||
/// Retrieve some confgen options given a relative path to the dotfile root and a struct type
|
||||
/// with a field for each option.
|
||||
pub fn confgenGet(comptime T: type, alloc: std.mem.Allocator) !T {
|
||||
const optjson_path = comptime std.fs.path.dirname(@src().file).? ++ "/../../cgout/opts.json";
|
||||
const optjson_path = comptime std.fs.path.dirname(@src().file).? ++ "/../../cgout/_cgfs/opts.json";
|
||||
var file = try std.fs.cwd().openFile(optjson_path, .{});
|
||||
defer file.close();
|
||||
var buf_reader = std.io.bufferedReader(file.reader());
|
||||
|
|
|
@ -28,6 +28,8 @@ pub fn build(b: *std.Build) !void {
|
|||
next: [:0]const u8,
|
||||
prev: [:0]const u8,
|
||||
},
|
||||
backlight_up: [:0]const u8,
|
||||
backlight_down: [:0]const u8,
|
||||
},
|
||||
cursor: struct {
|
||||
theme: [:0]const u8,
|
||||
|
|
|
@ -44,6 +44,10 @@ pub fn init(alloc: std.mem.Allocator, initial: bool) !void {
|
|||
.{ "None", "XF86AudioPlay", "spawn", journal_prefix ++ opt.commands.media.play_pause },
|
||||
.{ "None", "XF86AudioPrev", "spawn", journal_prefix ++ opt.commands.media.prev },
|
||||
.{ "None", "XF86AudioNext", "spawn", journal_prefix ++ opt.commands.media.next },
|
||||
|
||||
// light control
|
||||
.{ "None", "XF86MonBrightnessUp", "spawn", journal_prefix ++ opt.commands.backlight_up },
|
||||
.{ "None", "XF86MonBrightnessDown", "spawn", journal_prefix ++ opt.commands.backlight_down },
|
||||
|
||||
// control maps
|
||||
.{ "Super+Shift", "E", "exit" },
|
||||
|
|
|
@ -127,10 +127,9 @@
|
|||
(cmd "haxe" "build.hxml")))
|
||||
|
||||
(define-logging (generate-cgopt-json)
|
||||
(unless (directory-exists? "cgout")
|
||||
(make-directory "cgout"))
|
||||
(make-directory* "cgout/_cgfs")
|
||||
(call-with-output-file* #:exists 'truncate/replace
|
||||
"cgout/opts.json"
|
||||
"cgout/_cgfs/opts.json"
|
||||
(λ (outfile)
|
||||
(parameterize ([log-calls #f] [current-output-port outfile])
|
||||
(cmd "confgen" "--json-opt" "confgen.lua")))))
|
||||
|
|
Loading…
Reference in a new issue