Keyd : Add DRG shift key overload.

This commit is contained in:
Dmitry Voronin 2024-04-29 02:03:44 +03:00
parent 4e693f2301
commit dcc8942535
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
16 changed files with 81 additions and 78 deletions

View file

@ -26,6 +26,6 @@
vim.cmd("set list listchars=tab:>\\ ,trail:-,lead:.") vim.cmd("set list listchars=tab:>\\ ,trail:-,lead:.")
-- Relative line numbers. -- Relative line numbers.
vim.wo.relativenumber = ${setting.nvim.editor.relativenumber} vim.wo.relativenumber = ${toString(setting.nvim.editor.relativenumber)}
''; '';
} }

View file

@ -3,9 +3,9 @@
vim.opt.autoindent = true vim.opt.autoindent = true
vim.opt.expandtab = false vim.opt.expandtab = false
-- vim.opt.smartindent = true -- vim.opt.smartindent = true
vim.opt.shiftwidth = ${setting.nvim.editor.indent.default} vim.opt.shiftwidth = ${toString(setting.nvim.editor.indent.default)}
vim.opt.softtabstop = ${setting.nvim.editor.indent.default} vim.opt.softtabstop = ${toString(setting.nvim.editor.indent.default)}
vim.opt.tabstop = ${setting.nvim.editor.indent.default} vim.opt.tabstop = ${toString(setting.nvim.editor.indent.default)}
-- Disable Markdown forced formatting. -- Disable Markdown forced formatting.
vim.g.markdown_recommended_style = 0 vim.g.markdown_recommended_style = 0

View file

@ -19,10 +19,10 @@
rekey_normal("<Leader>${key.action.hide}", "<C-w>q") -- Close split. rekey_normal("<Leader>${key.action.hide}", "<C-w>q") -- Close split.
-- Resize splits. -- Resize splits.
rekey_normal("<Leader>${key.action.resize.left}", "${setting.tmux.resize.step.horizontal}<C-w><") rekey_normal("<Leader>${key.action.resize.left}", "${toString(setting.tmux.resize.step.horizontal)}<C-w><")
rekey_normal("<Leader>${key.action.resize.right}", "${setting.tmux.resize.step.horizontal}<C-w>>") rekey_normal("<Leader>${key.action.resize.right}", "${toString(setting.tmux.resize.step.horizontal)}<C-w>>")
rekey_normal("<Leader>${key.action.resize.down}", "${setting.tmux.resize.step.vertical}<C-w>+") rekey_normal("<Leader>${key.action.resize.down}", "${toString(setting.tmux.resize.step.vertical)}<C-w>+")
rekey_normal("<Leader>${key.action.resize.up}", "${setting.tmux.resize.step.vertical}<C-w>-") rekey_normal("<Leader>${key.action.resize.up}", "${toString(setting.tmux.resize.step.vertical)}<C-w>-")
-- Move splits. -- Move splits.
rekey_normal("<Leader>${key.navigation.move.left}", "<C-w>A") rekey_normal("<Leader>${key.navigation.move.left}", "<C-w>A")

View file

@ -32,10 +32,10 @@ in {
bind -n ${mod}-${key.action.split.vertical} split-window -h -c "#{pane_current_path}" bind -n ${mod}-${key.action.split.vertical} split-window -h -c "#{pane_current_path}"
bind -n ${mod}-${key.action.split.horizontal} split-window -v -c "#{pane_current_path}" bind -n ${mod}-${key.action.split.horizontal} split-window -v -c "#{pane_current_path}"
bind -n ${mod}-${key.action.resize.equalize} select-layout tiled bind -n ${mod}-${key.action.resize.equalize} select-layout tiled
bind -n ${mod}-${key.action.resize.up} resize-pane -U ${setting.tmux.resize.step.vertical} bind -n ${mod}-${key.action.resize.up} resize-pane -U ${toString(setting.tmux.resize.step.vertical)}
bind -n ${mod}-${key.action.resize.down} resize-pane -D ${setting.tmux.resize.step.vertical} bind -n ${mod}-${key.action.resize.down} resize-pane -D ${toString(setting.tmux.resize.step.vertical)}
bind -n ${mod}-${key.action.resize.left} resize-pane -L ${setting.tmux.resize.step.horizontal} bind -n ${mod}-${key.action.resize.left} resize-pane -L ${toString(setting.tmux.resize.step.horizontal)}
bind -n ${mod}-${key.action.resize.right} resize-pane -R ${setting.tmux.resize.step.horizontal} bind -n ${mod}-${key.action.resize.right} resize-pane -R ${toString(setting.tmux.resize.step.horizontal)}
bind -n ${mod}-${key.navigation.move.left} swap-pane -U bind -n ${mod}-${key.navigation.move.left} swap-pane -U
bind -n ${mod}-${key.navigation.move.right} swap-pane -D bind -n ${mod}-${key.navigation.move.right} swap-pane -D
unbind '"' unbind '"'
@ -73,14 +73,14 @@ in {
# Statusbar. # Statusbar.
bind-key -n ${mod}-${key.tmux.status.toggle} set-option -g status; bind-key -n ${mod}-${key.tmux.status.toggle} set-option -g status;
bind-key -n ${mod}-${key.tmux.status.uber} run-shell 'tmux_script togglestatusbar' bind-key -n ${mod}-${key.tmux.status.uber} run-shell 'tmux_script togglestatusbar'
set -g status-interval ${setting.tmux.status.interval} set -g status-interval ${toString(setting.tmux.status.interval)}
set -g status-position bottom set -g status-position bottom
set -g status-justify left set -g status-justify left
set -g status-style "fg=#${fg}" set -g status-style "fg=#${fg}"
set -g status-left "#[bold] #H-#S #(tmux_script client_count #S)" set -g status-left "#[bold] #H-#S #(tmux_script client_count #S)"
set -g status-left-length ${setting.tmux.status.length} set -g status-left-length ${toString(setting.tmux.status.length)}
set -g status-right-length ${setting.tmux.status.length} set -g status-right-length ${toString(setting.tmux.status.length)}
set -g status-right "#(tmux_script statusbar) %d %a #[bold] %H:%M " set -g status-right "#(tmux_script statusbar) %d %a #[bold] %H:%M "
set-window-option -g window-status-separator "" set-window-option -g window-status-separator ""
@ -133,13 +133,13 @@ in {
[[ "''${status}" = "Charging" ]] && is_charging=true [[ "''${status}" = "Charging" ]] && is_charging=true
local icon local icon
if ((level>=${setting.tmux.status.battery.threshold.high})) if ((level>=${toString(setting.tmux.status.battery.threshold.high)}))
then then
icon="󱊣" icon="󱊣"
elif ((level>=${setting.tmux.status.battery.threshold.medium})) elif ((level>=${toString(setting.tmux.status.battery.threshold.medium)}))
then then
icon="󱊢" icon="󱊢"
elif ((level>=${setting.tmux.status.battery.threshold.low})) elif ((level>=${toString(setting.tmux.status.battery.threshold.low)}))
then then
icon="󱊡" icon="󱊡"
else else
@ -159,13 +159,13 @@ in {
[[ "''${level}" = "00" ]] && level="0" [[ "''${level}" = "00" ]] && level="0"
local icon local icon
if ((level>=${setting.tmux.status.volume.threshold.high})) if ((level>=${toString(setting.tmux.status.volume.threshold.high)}))
then then
icon="󰕾" icon="󰕾"
elif ((level>=${setting.tmux.status.volume.threshold.medium})) elif ((level>=${toString(setting.tmux.status.volume.threshold.medium)}))
then then
icon="󰖀" icon="󰖀"
elif ((level>=${setting.tmux.status.volume.threshold.low})) elif ((level>=${toString(setting.tmux.status.volume.threshold.low)}))
then then
icon="" icon=""
else else
@ -184,8 +184,8 @@ in {
function _tmux_statusbar() { function _tmux_statusbar() {
local IFS=$'\n' local IFS=$'\n'
local sep="" local sep=""
local thr_volume=${setting.tmux.status.volume.threshold.show} local thr_volume=${toString(setting.tmux.status.volume.threshold.show)}
local thr_battery=${setting.tmux.status.battery.threshold.show} local thr_battery=${toString(setting.tmux.status.battery.threshold.show)}
local is_uber=$(cat "/tmp/.tmux_uber" || echo -n false) local is_uber=$(cat "/tmp/.tmux_uber" || echo -n false)
# Get data. # Get data.

View file

@ -1,4 +1,4 @@
{ pkgs, wallpaper, style, util, ... } @args: let { pkgs, wallpaper, style, util, setting, ... } @args: let
mkConfig = { modules }: builtins.foldl' (acc: mod: mkConfig = { modules }: builtins.foldl' (acc: mod:
acc + (import mod args).text acc + (import mod args).text
) "" modules; ) "" modules;

View file

@ -1,5 +1,5 @@
{ setting, ... }: let { setting, ... }: let
step = setting.brightness.step; step = toString(setting.brightness.step);
in { in {
text = '' text = ''
bindsym XF86MonBrightnessDown exec light -U ${step} bindsym XF86MonBrightnessDown exec light -U ${step}

View file

@ -38,6 +38,6 @@
} }
# Hide mouse cursor after a period of inactivity. # Hide mouse cursor after a period of inactivity.
seat seat0 hide_cursor ${setting.popup.timeout.ms} seat seat0 hide_cursor ${toString(setting.popup.timeout.ms)}
''; '';
} }

View file

@ -1,8 +1,8 @@
{ key, setting, ... }: { { key, setting, ... }: {
text = '' text = ''
bindsym $mod+${key.action.resize.down} resize grow height ${setting.sway.resize.step.vertical} bindsym $mod+${key.action.resize.down} resize grow height ${toString(setting.sway.resize.step.vertical)}
bindsym $mod+${key.action.resize.up} resize shrink height ${setting.sway.resize.step.vertical} bindsym $mod+${key.action.resize.up} resize shrink height ${toString(setting.sway.resize.step.vertical)}
bindsym $mod+${key.action.resize.left} resize shrink width ${setting.sway.resize.step.horizontal} bindsym $mod+${key.action.resize.left} resize shrink width ${toString(setting.sway.resize.step.horizontal)}
bindsym $mod+${key.action.resize.right} resize grow width ${setting.sway.resize.step.horizontal} bindsym $mod+${key.action.resize.right} resize grow width ${toString(setting.sway.resize.step.horizontal)}
''; '';
} }

View file

@ -1,6 +1,6 @@
{ setting, ... }: let { setting, ... }: let
step_volume = setting.volume.step; step_volume = toString(setting.volume.step);
step_music = setting.music.step; step_music = toString(setting.music.step);
in { in {
text = '' text = ''
bindsym XF86AudioRaiseVolume exec 'pactl set-sink-volume @DEFAULT_SINK@ +${step_volume}%' bindsym XF86AudioRaiseVolume exec 'pactl set-sink-volume @DEFAULT_SINK@ +${step_volume}%'

View file

@ -20,7 +20,7 @@
bindsym $mod+${key.sway.window.fullscreen} fullscreen bindsym $mod+${key.sway.window.fullscreen} fullscreen
# Dim inactive windows. # Dim inactive windows.
exec $SWAY_IWT_PATH --opacity ${setting.sway.window.opacity.inactive} exec $SWAY_IWT_PATH --opacity ${toString(setting.sway.window.opacity.inactive)}
# Drag floating windows by holding down $mod and left mouse button. # Drag floating windows by holding down $mod and left mouse button.
# Resize them with right mouse button + $mod. # Resize them with right mouse button + $mod.
@ -33,7 +33,7 @@
bindsym $mod+${key.action.close} kill bindsym $mod+${key.action.close} kill
# Add gaps. # Add gaps.
gaps inner ${setting.sway.window.gap} gaps inner ${toString(setting.sway.window.gap)}
# Launch everything tiled. # Launch everything tiled.
# for_window [all] floating disable # for_window [all] floating disable

View file

@ -1,61 +1,62 @@
{ ... }: { { ... }: {
tmux = { tmux = {
resize.step = { resize.step = {
vertical = "1"; vertical = 1;
horizontal = "1"; horizontal = 1;
}; };
status = { status = {
interval = "2"; interval = 2;
length = "50"; length = 50;
battery.threshold = { battery.threshold = {
high = "60"; high = 60;
medium = "40"; medium = 40;
low = "20"; low = 20;
show = "40"; show = 40;
}; };
volume.threshold = { volume.threshold = {
high = "80"; high = 80;
medium = "40"; medium = 40;
low = "10"; low = 10;
show = "100"; show = 100;
}; };
}; };
}; };
nvim = { nvim = {
editor = { editor = {
relativenumber = "true"; relativenumber = true;
indent.default = "2"; indent.default = 2;
}; };
resize.step = { resize.step = {
vertical = "2"; vertical = 2;
horizontal = "4"; horizontal = 4;
}; };
}; };
sway = { sway = {
resize.step = { resize.step = {
vertical = "10px"; vertical = 10;
horizontal = "10px"; horizontal = 10;
}; };
window = { window = {
gap = "10"; gap = 10;
opacity.inactive = "0.85"; opacity.inactive = 0.85;
}; };
}; };
foot = { foot = {
font = { font = {
step = "1"; step = 1;
dpi = "yes"; dpi = true;
forceWhite = false; forceWhite = false;
}; };
}; };
top.refresh.ms = "2000"; top.refresh.ms = 2000;
popup.timeout.ms = "5000"; popup.timeout.ms = 5000;
brightness.step = "5"; brightness.step = 5;
volume.step = "5"; volume.step = 5;
music.step = "10"; music.step = 10;
keyd.timeout = 200;
} }

View file

@ -4,14 +4,15 @@
'' else '' '' else ''
foreground=${style.color.fg.light} foreground=${style.color.fg.light}
''; '';
dpiaware = if setting.foot.font.dpi then "yes" else "no";
in { in {
config = util.trimTabs '' config = util.trimTabs ''
font=${style.font.monospace.name}:size=${toString(style.font.size.terminal)} font=${style.font.monospace.name}:size=${toString(style.font.size.terminal)}
# font-bold=${style.font.monospace.name}:size=${toString(style.font.size.terminal)} # font-bold=${style.font.monospace.name}:size=${toString(style.font.size.terminal)}
font-italic=${style.font.monospace.name}:size=${toString(style.font.size.terminal)} font-italic=${style.font.monospace.name}:size=${toString(style.font.size.terminal)}
font-bold-italic=${style.font.monospace.name}:size=${toString(style.font.size.terminal)} font-bold-italic=${style.font.monospace.name}:size=${toString(style.font.size.terminal)}
dpi-aware=${setting.foot.font.dpi} dpi-aware=${dpiaware}
font-size-adjustment=${setting.foot.font.step} font-size-adjustment=${toString(setting.foot.font.step)}
[colors] [colors]
alpha=${toString(style.opacity.terminal)} alpha=${toString(style.opacity.terminal)}

View file

@ -1,3 +1,3 @@
{ util, ... } @args: { { util, setting, ... } @args: {
config = util.catAllText ./module args; config = util.catAllText ./module args;
} }

View file

@ -1,6 +1,7 @@
{ ... }: { { setting, ... }: {
text = '' text = ''
[steam-app-548430] [steam-app-548430]
leftshift = timeout(leftcontrol, ${toString(setting.keyd.timeout)}, leftshift)
alt.w = macro(enter 10ms r enter) alt.w = macro(enter 10ms r enter)
alt.a = macro(enter 10ms N o enter) alt.a = macro(enter 10ms N o enter)
alt.s = macro(enter 10ms W a i t enter) alt.s = macro(enter 10ms W a i t enter)

View file

@ -1,7 +1,7 @@
{ style, util, setting, ... }: { { style, util, setting, ... }: {
config = util.trimTabs '' config = util.trimTabs ''
anchor=top-center anchor=top-center
default-timeout=${setting.popup.timeout.ms} default-timeout=${toString(setting.popup.timeout.ms)}
font=${style.font.serif.name} ${toString(style.font.size.popup)} font=${style.font.serif.name} ${toString(style.font.size.popup)}
background-color=#${style.color.bg.dark} background-color=#${style.color.bg.dark}
border-color=#${style.color.bg.regular} border-color=#${style.color.bg.regular}

View file

@ -55,7 +55,7 @@
shown_boxes = "cpu mem net proc" shown_boxes = "cpu mem net proc"
#* Update time in milliseconds, recommended 2000 ms or above for better sample times for graphs. #* Update time in milliseconds, recommended 2000 ms or above for better sample times for graphs.
update_ms = ${setting.top.refresh.ms} update_ms = ${toString(setting.top.refresh.ms)}
#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu direct", #* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu direct",
#* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" updates top process directly. #* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" updates top process directly.