fix: right click
This commit is contained in:
parent
0703deacce
commit
310bd074e7
3 changed files with 47 additions and 64 deletions
17
config/cp/.clang-format
Normal file
17
config/cp/.clang-format
Normal 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
|
||||||
|
|
@ -58,24 +58,6 @@ end
|
||||||
|
|
||||||
local git_status = new_git_status()
|
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 {
|
return {
|
||||||
{
|
{
|
||||||
'barrettruth/midnight.nvim',
|
'barrettruth/midnight.nvim',
|
||||||
|
|
@ -258,34 +240,27 @@ return {
|
||||||
panel = { diff_modes = { 'side-by-side', 'git' } },
|
panel = { diff_modes = { 'side-by-side', 'git' } },
|
||||||
},
|
},
|
||||||
hooks = {
|
hooks = {
|
||||||
setup_io_input = function(buf)
|
setup = {
|
||||||
require('cp.helpers').clearcol(buf)
|
contest = function(state)
|
||||||
end,
|
local dir = vim.fn.fnamemodify(state.get_source_file(state.get_language()), ':h')
|
||||||
setup_io_output = function(buf)
|
local path = dir .. '/.clang-format'
|
||||||
require('cp.helpers').clearcol(buf)
|
if vim.fn.filereadable(path) == 0 then
|
||||||
end,
|
vim.fn.system({ 'cp', vim.fn.expand('~/.config/nix/config/cp/.clang-format'), path })
|
||||||
before_run = function(_)
|
end
|
||||||
require('config.lsp').format()
|
end,
|
||||||
end,
|
code = function(_)
|
||||||
before_debug = function(_)
|
vim.opt_local.foldlevel = 0
|
||||||
require('config.lsp').format()
|
vim.opt_local.foldmethod = 'marker'
|
||||||
end,
|
vim.opt_local.foldmarker = '{{{,}}}'
|
||||||
setup_code = function(_)
|
vim.opt_local.foldtext = ''
|
||||||
vim.opt_local.winbar = ''
|
vim.diagnostic.enable(false)
|
||||||
vim.opt_local.foldlevel = 0
|
end,
|
||||||
vim.opt_local.foldmethod = 'marker'
|
},
|
||||||
vim.opt_local.foldmarker = '{{{,}}}'
|
on = {
|
||||||
vim.opt_local.foldtext = ''
|
enter = function(_) vim.opt_local.winbar = '' end,
|
||||||
vim.diagnostic.enable(false)
|
run = function(_) require('config.lsp').format() end,
|
||||||
|
debug = function(_) require('config.lsp').format() end,
|
||||||
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,
|
|
||||||
},
|
},
|
||||||
filename = function(_, _, problem_id)
|
filename = function(_, _, problem_id)
|
||||||
return problem_id
|
return problem_id
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ in
|
||||||
"custom/keyboard"
|
"custom/keyboard"
|
||||||
"privacy"
|
"privacy"
|
||||||
"custom/mic"
|
"custom/mic"
|
||||||
"pulseaudio"
|
"custom/pulseaudio"
|
||||||
"network"
|
"network"
|
||||||
"battery"
|
"battery"
|
||||||
"clock"
|
"clock"
|
||||||
|
|
@ -165,24 +165,16 @@ in
|
||||||
on-scroll-down = "wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 5%-";
|
on-scroll-down = "wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 5%-";
|
||||||
};
|
};
|
||||||
|
|
||||||
pulseaudio = {
|
"custom/pulseaudio" = {
|
||||||
format = "{icon}";
|
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}%\"}"' '';
|
||||||
format-muted = "";
|
return-type = "json";
|
||||||
format-icons = {
|
interval = 1;
|
||||||
default = [
|
|
||||||
""
|
|
||||||
""
|
|
||||||
""
|
|
||||||
];
|
|
||||||
};
|
|
||||||
signal = 1;
|
signal = 1;
|
||||||
tooltip = true;
|
|
||||||
tooltip-format = "Volume: {volume}%\nOutput: {desc}";
|
|
||||||
on-click = "ctl audio sink";
|
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-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-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";
|
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%-";
|
on-scroll-down = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-; pkill -RTMIN+1 waybar";
|
||||||
};
|
};
|
||||||
|
|
||||||
network = {
|
network = {
|
||||||
|
|
@ -234,7 +226,6 @@ in
|
||||||
format = " {:%a %d/%m/%Y %H:%M:%S}";
|
format = " {:%a %d/%m/%Y %H:%M:%S}";
|
||||||
interval = 1;
|
interval = 1;
|
||||||
tooltip = false;
|
tooltip = false;
|
||||||
on-click-right = "notify-send test 'right click'";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
"custom/power" = {
|
"custom/power" = {
|
||||||
|
|
@ -273,7 +264,7 @@ in
|
||||||
#privacy,
|
#privacy,
|
||||||
#tray,
|
#tray,
|
||||||
#custom-mic,
|
#custom-mic,
|
||||||
#pulseaudio,
|
#custom-pulseaudio,
|
||||||
#network,
|
#network,
|
||||||
#battery,
|
#battery,
|
||||||
#clock,
|
#clock,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue