misc cleanups
This commit is contained in:
parent
9d612dc9cc
commit
749f79c4b6
10 changed files with 63 additions and 73 deletions
|
|
@ -13,54 +13,46 @@ function _G.bmap(mapping, opts)
|
||||||
_G.map(mapping, vim.tbl_extend('force', opts or {}, { buffer = 0 }))
|
_G.map(mapping, vim.tbl_extend('force', opts or {}, { buffer = 0 }))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local disabled_plugins = {
|
||||||
|
'2html_plugin',
|
||||||
|
'bugreport',
|
||||||
|
'getscript',
|
||||||
|
'getscriptPlugin',
|
||||||
|
'gzip',
|
||||||
|
'logipat',
|
||||||
|
'netrw',
|
||||||
|
'netrwFileHandlers',
|
||||||
|
'netrwPlugin',
|
||||||
|
'netrwSettings',
|
||||||
|
'optwin',
|
||||||
|
'rplugin',
|
||||||
|
'rrhelper',
|
||||||
|
'synmenu',
|
||||||
|
'tar',
|
||||||
|
'tarPlugin',
|
||||||
|
'tohtml',
|
||||||
|
'tutor',
|
||||||
|
'vimball',
|
||||||
|
'vimballPlugin',
|
||||||
|
'zip',
|
||||||
|
'zipPlugin',
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, plugin in ipairs(disabled_plugins) do
|
||||||
|
vim.g['loaded_' .. plugin] = 1
|
||||||
|
end
|
||||||
|
|
||||||
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
|
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
|
||||||
if not vim.uv.fs_stat(lazypath) then
|
if not vim.uv.fs_stat(lazypath) then
|
||||||
vim.fn.system({
|
vim.fn.system({
|
||||||
'git',
|
'git',
|
||||||
'clone',
|
'clone',
|
||||||
'git@github.com:folke/lazy.nvim.git',
|
'https://github.com/folke/lazy.nvim.git',
|
||||||
lazypath,
|
lazypath,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
require('lazy').setup('plugins', {
|
require('lazy').setup('plugins', {
|
||||||
git = { url_format = 'git@github.com:%s.git' },
|
|
||||||
change_detection = { enabled = false },
|
change_detection = { enabled = false },
|
||||||
performance = {
|
|
||||||
cache = {
|
|
||||||
enabled = true,
|
|
||||||
},
|
|
||||||
reset_packpath = true,
|
|
||||||
rtp = {
|
|
||||||
reset = true,
|
|
||||||
disabled_plugins = {
|
|
||||||
'gzip',
|
|
||||||
'netrwPlugin',
|
|
||||||
'tarPlugin',
|
|
||||||
'tohtml',
|
|
||||||
'tutor',
|
|
||||||
'zipPlugin',
|
|
||||||
'2html_plugin',
|
|
||||||
'getscript',
|
|
||||||
'getscriptPlugin',
|
|
||||||
'logipat',
|
|
||||||
'netrw',
|
|
||||||
'netrwSettings',
|
|
||||||
'netrwFileHandlers',
|
|
||||||
'tar',
|
|
||||||
'tarPlugin',
|
|
||||||
'rrhelper',
|
|
||||||
'vimball',
|
|
||||||
'vimballPlugin',
|
|
||||||
'zip',
|
|
||||||
'zipPlugin',
|
|
||||||
'tutor',
|
|
||||||
'rplugin',
|
|
||||||
'synmenu',
|
|
||||||
'optwin',
|
|
||||||
'bugreport',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ return {
|
||||||
{ '<leader>fr', '<cmd>FzfLua resume<cr>' },
|
{ '<leader>fr', '<cmd>FzfLua resume<cr>' },
|
||||||
{
|
{
|
||||||
'<leader>fs',
|
'<leader>fs',
|
||||||
'<cmd>FzfLua files cwd=~/.local/bin/scripts<cr>',
|
'<cmd>FzfLua files cwd=~/.config/nix/scripts<cr>',
|
||||||
},
|
},
|
||||||
{ '<leader>GB', '<cmd>FzfLua git_branches<cr>' },
|
{ '<leader>GB', '<cmd>FzfLua git_branches<cr>' },
|
||||||
{ '<leader>Gb', '<cmd>FzfLua git_worktrees<cr>' },
|
{ '<leader>Gb', '<cmd>FzfLua git_worktrees<cr>' },
|
||||||
|
|
|
||||||
1
fonts
1
fonts
|
|
@ -1 +0,0 @@
|
||||||
/nix/store/sp0mz2yc3344ncbnaphfsapx67ankmn8-home-manager-files/.local/share/fonts
|
|
||||||
|
|
@ -43,6 +43,9 @@
|
||||||
# runtime/tools
|
# runtime/tools
|
||||||
nodejs
|
nodejs
|
||||||
websocat
|
websocat
|
||||||
|
luarocks
|
||||||
|
tree-sitter
|
||||||
|
(texlive.combine { inherit (texlive) scheme-small latexindent; })
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,6 @@ in
|
||||||
|
|
||||||
home.sessionPath = [
|
home.sessionPath = [
|
||||||
"${config.home.homeDirectory}/.local/bin"
|
"${config.home.homeDirectory}/.local/bin"
|
||||||
"${config.home.homeDirectory}/.local/bin/scripts"
|
|
||||||
]
|
]
|
||||||
++ lib.optionals rust [ "${config.xdg.dataHome}/cargo/bin" ]
|
++ lib.optionals rust [ "${config.xdg.dataHome}/cargo/bin" ]
|
||||||
++ lib.optionals go [ "${config.xdg.dataHome}/go/bin" ]
|
++ lib.optionals go [ "${config.xdg.dataHome}/go/bin" ]
|
||||||
|
|
@ -169,10 +168,6 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
home.file.".zshenv".text = ''
|
|
||||||
export THEME="${config.theme}"
|
|
||||||
'';
|
|
||||||
|
|
||||||
programs.zsh = {
|
programs.zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
dotDir = "${config.xdg.configHome}/zsh";
|
dotDir = "${config.xdg.configHome}/zsh";
|
||||||
|
|
|
||||||
|
|
@ -537,7 +537,7 @@ in
|
||||||
|
|
||||||
home.activation.linkWaybarTheme = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
home.activation.linkWaybarTheme = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
target="${config.xdg.configHome}/waybar/themes/theme.css"
|
target="${config.xdg.configHome}/waybar/themes/theme.css"
|
||||||
[ -L "$target" ] || $DRY_RUN_CMD ln -sf "${config.xdg.configHome}/waybar/themes/${config.theme}.css" "$target"
|
$DRY_RUN_CMD ln -sf "${config.xdg.configHome}/waybar/themes/${config.theme}.css" "$target"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
xdg.configFile."X11".source =
|
xdg.configFile."X11".source =
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,7 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
shellInit = ''
|
shellInit = ''
|
||||||
export ZDOTDIR="$HOME/.config/zsh"
|
export ZDOTDIR="$HOME/.config/zsh"
|
||||||
|
export THEME="midnight"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
programs.hyprland.enable = true;
|
programs.hyprland.enable = true;
|
||||||
|
|
|
||||||
20
scripts/ctl
20
scripts/ctl
|
|
@ -72,29 +72,27 @@ keyboard)
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
audio)
|
audio)
|
||||||
require pactl
|
require wpctl pw-dump jq
|
||||||
case "$2" in
|
case "$2" in
|
||||||
out)
|
out)
|
||||||
sinks="$(pactl list short sinks | awk '{print $1": "$2}')"
|
sinks="$(pw-dump | jq -r '.[] | select(.info.props."media.class" == "Audio/Sink") | "\(.id)\t\(.info.props."node.description" // .info.props."node.name" // "unknown")"')"
|
||||||
[ -z "$sinks" ] && exit 0
|
[ -z "$sinks" ] && exit 0
|
||||||
count="$(printf "%s\n" "$sinks" | wc -l)"
|
|
||||||
if [ "$XDG_SESSION_TYPE" = x11 ]; then
|
if [ "$XDG_SESSION_TYPE" = x11 ]; then
|
||||||
choice="$(printf "%s\n" "$sinks" | dmenu -i -l "$count" -p "select sink:" | cut -d: -f1)"
|
choice="$(printf "%s\n" "$sinks" | awk -F'\t' '{print $1": "$2}' | dmenu -i -p "select sink:" | cut -d: -f1)"
|
||||||
else
|
else
|
||||||
choice="$(printf "%s\n" "$sinks" | rofi -dmenu -i -lines "$count" -p "select sink" | cut -d: -f1)"
|
choice="$(printf "%s\n" "$sinks" | awk -F'\t' '{print $1": "$2}' | rofi -dmenu -i -p "select sink" | cut -d: -f1)"
|
||||||
fi
|
fi
|
||||||
[ "$choice" ] && pactl set-default-sink "$choice"
|
[ "$choice" ] && wpctl set-default "$choice"
|
||||||
;;
|
;;
|
||||||
in)
|
in)
|
||||||
sources="$(pactl list short sources | awk '{print $1": "$2}')"
|
sources="$(pw-dump | jq -r '.[] | select(.info.props."media.class" == "Audio/Source") | "\(.id)\t\(.info.props."node.description" // .info.props."node.name" // "unknown")"')"
|
||||||
[ -z "$sources" ] && exit 0
|
[ -z "$sources" ] && exit 0
|
||||||
count="$(printf "%s\n" "$sources" | wc -l)"
|
|
||||||
if [ "$XDG_SESSION_TYPE" = x11 ]; then
|
if [ "$XDG_SESSION_TYPE" = x11 ]; then
|
||||||
choice="$(printf "%s\n" "$sources" | dmenu -i -l "$count" -p "select source:" | cut -d: -f1)"
|
choice="$(printf "%s\n" "$sources" | awk -F'\t' '{print $1": "$2}' | dmenu -i -p "select source:" | cut -d: -f1)"
|
||||||
else
|
else
|
||||||
choice="$(printf "%s\n" "$sources" | rofi -dmenu -i -lines "$count" -p "select source" | cut -d: -f1)"
|
choice="$(printf "%s\n" "$sources" | awk -F'\t' '{print $1": "$2}' | rofi -dmenu -i -p "select source" | cut -d: -f1)"
|
||||||
fi
|
fi
|
||||||
[ "$choice" ] && pactl set-default-source "$choice"
|
[ "$choice" ] && wpctl set-default "$choice"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: ctl audio {in|out}" >&2
|
echo "Usage: ctl audio {in|out}" >&2
|
||||||
|
|
|
||||||
23
scripts/hypr
23
scripts/hypr
|
|
@ -66,26 +66,20 @@ brightness)
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
volume)
|
volume)
|
||||||
require pactl notify-send
|
require wpctl notify-send
|
||||||
SINK="@DEFAULT_SINK@"
|
SINK="@DEFAULT_AUDIO_SINK@"
|
||||||
VOL_STEP=5
|
VOL_STEP=5
|
||||||
get_vol() { pactl get-sink-volume "$SINK" | awk 'NR==1{print $5+0}'; }
|
get_vol() { wpctl get-volume "$SINK" | awk '{printf "%d", $2 * 100}'; }
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
up)
|
up)
|
||||||
vol=$(get_vol)
|
wpctl set-volume "$SINK" "${VOL_STEP}%+" --limit 1.0
|
||||||
[ "$vol" -lt 100 ] && vol=$((vol + VOL_STEP))
|
|
||||||
[ "$vol" -gt 100 ] && vol=100
|
|
||||||
pactl set-sink-volume "$SINK" "${vol}%"
|
|
||||||
;;
|
;;
|
||||||
down)
|
down)
|
||||||
vol=$(get_vol)
|
wpctl set-volume "$SINK" "${VOL_STEP}%-"
|
||||||
vol=$((vol - VOL_STEP))
|
|
||||||
[ "$vol" -lt 0 ] && vol=0
|
|
||||||
pactl set-sink-volume "$SINK" "${vol}%"
|
|
||||||
;;
|
;;
|
||||||
toggle)
|
toggle)
|
||||||
pactl set-sink-mute "$SINK" toggle
|
wpctl set-mute "$SINK" toggle
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Invalid subcommand: $1" >&2
|
echo "Invalid subcommand: $1" >&2
|
||||||
|
|
@ -93,11 +87,8 @@ volume)
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
muted=$(pactl get-sink-mute "$SINK" | awk '{print $2}')
|
|
||||||
vol=$(get_vol)
|
vol=$(get_vol)
|
||||||
[ "$vol" -gt 100 ] && vol=100
|
if wpctl get-volume "$SINK" | grep -q MUTED; then
|
||||||
|
|
||||||
if [ "$muted" = "yes" ]; then
|
|
||||||
notify-send -u low -t 2500 -r 5556 "volume: ${vol}% (muted)"
|
notify-send -u low -t 2500 -r 5556 "volume: ${vol}% (muted)"
|
||||||
else
|
else
|
||||||
notify-send -u low -t 2500 -r 5556 "volume: ${vol}%"
|
notify-send -u low -t 2500 -r 5556 "volume: ${vol}%"
|
||||||
|
|
|
||||||
11
todo.md
Normal file
11
todo.md
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
# todo
|
||||||
|
|
||||||
|
tmux colorschemes
|
||||||
|
|
||||||
|
everything else
|
||||||
|
|
||||||
|
auto setup
|
||||||
|
|
||||||
|
using nix shell
|
||||||
|
|
||||||
|
audio
|
||||||
Loading…
Add table
Add a link
Reference in a new issue