fix: right click

This commit is contained in:
Barrett Ruth 2026-03-03 00:27:56 -05:00
parent 0703deacce
commit 310bd074e7
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
3 changed files with 47 additions and 64 deletions

17
config/cp/.clang-format Normal file
View file

@ -0,0 +1,17 @@
BasedOnStyle: LLVM
IndentWidth: 2
UseTab: Never
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortLambdasOnASingleLine: None
AllowShortBlocksOnASingleLine: Never
AllowShortEnumsOnASingleLine: false
AllowShortCaseExpressionOnASingleLine: false
BreakBeforeBraces: Attach
ColumnLimit: 100
AlignAfterOpenBracket: Align
BinPackArguments: false
BinPackParameters: false

View file

@ -58,24 +58,6 @@ end
local git_status = new_git_status()
local clang_format = [[BasedOnStyle: LLVM
IndentWidth: 2
UseTab: Never
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortLambdasOnASingleLine: None
AllowShortBlocksOnASingleLine: Never
AllowShortEnumsOnASingleLine: false
AllowShortCaseExpressionOnASingleLine: false
BreakBeforeBraces: Attach
ColumnLimit: 100
AlignAfterOpenBracket: Align
BinPackArguments: false
BinPackParameters: false]]
return {
{
'barrettruth/midnight.nvim',
@ -258,35 +240,28 @@ return {
panel = { diff_modes = { 'side-by-side', 'git' } },
},
hooks = {
setup_io_input = function(buf)
require('cp.helpers').clearcol(buf)
setup = {
contest = function(state)
local dir = vim.fn.fnamemodify(state.get_source_file(state.get_language()), ':h')
local path = dir .. '/.clang-format'
if vim.fn.filereadable(path) == 0 then
vim.fn.system({ 'cp', vim.fn.expand('~/.config/nix/config/cp/.clang-format'), path })
end
end,
setup_io_output = function(buf)
require('cp.helpers').clearcol(buf)
end,
before_run = function(_)
require('config.lsp').format()
end,
before_debug = function(_)
require('config.lsp').format()
end,
setup_code = function(_)
vim.opt_local.winbar = ''
code = function(_)
vim.opt_local.foldlevel = 0
vim.opt_local.foldmethod = 'marker'
vim.opt_local.foldmarker = '{{{,}}}'
vim.opt_local.foldtext = ''
vim.diagnostic.enable(false)
local clang_format_path = vim.fn.getcwd() .. '/.clang-format'
if vim.fn.filereadable(clang_format_path) == 0 then
vim.fn.writefile(
vim.split(clang_format, '\n'),
clang_format_path
)
end
end,
},
on = {
enter = function(_) vim.opt_local.winbar = '' end,
run = function(_) require('config.lsp').format() end,
debug = function(_) require('config.lsp').format() end,
},
},
filename = function(_, _, problem_id)
return problem_id
end,

View file

@ -112,7 +112,7 @@ in
"custom/keyboard"
"privacy"
"custom/mic"
"pulseaudio"
"custom/pulseaudio"
"network"
"battery"
"clock"
@ -165,24 +165,16 @@ in
on-scroll-down = "wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 5%-";
};
pulseaudio = {
format = "{icon}";
format-muted = "󰖁";
format-icons = {
default = [
"󰕿"
"󰖀"
"󰕾"
];
};
"custom/pulseaudio" = {
exec = ''sh -c 'out=$(wpctl get-volume @DEFAULT_AUDIO_SINK@); vol=$(echo "$out" | awk "{printf \"%d\", \$2 * 100}"); if echo "$out" | grep -q MUTED; then icon="󰖁"; elif [ "$vol" -le 33 ]; then icon="󰕿"; elif [ "$vol" -le 66 ]; then icon="󰖀"; else icon="󰕾"; fi; echo "{\"text\":\"$icon\",\"tooltip\":\"Volume: ''${vol}%\"}"' '';
return-type = "json";
interval = 1;
signal = 1;
tooltip = true;
tooltip-format = "Volume: {volume}%\nOutput: {desc}";
on-click = "ctl audio sink";
on-click-right = "pgrep -f 'waybar.*slider' && pkill -f 'waybar.*slider' || (waybar -c ${config.xdg.configHome}/waybar/slider.json &)";
on-click-middle = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
on-scroll-up = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ --limit 1.0";
on-scroll-down = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-";
on-click-middle = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle; pkill -RTMIN+1 waybar";
on-scroll-up = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ --limit 1.0; pkill -RTMIN+1 waybar";
on-scroll-down = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-; pkill -RTMIN+1 waybar";
};
network = {
@ -234,7 +226,6 @@ in
format = " {:%a %d/%m/%Y %H:%M:%S}";
interval = 1;
tooltip = false;
on-click-right = "notify-send test 'right click'";
};
"custom/power" = {
@ -273,7 +264,7 @@ in
#privacy,
#tray,
#custom-mic,
#pulseaudio,
#custom-pulseaudio,
#network,
#battery,
#clock,