fix(waybar): icon spacing
This commit is contained in:
parent
f81997f94d
commit
136ac9fba0
5 changed files with 37 additions and 51 deletions
|
|
@ -58,4 +58,6 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
end
|
end
|
||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
require('lazy').setup('plugins')
|
require('lazy').setup('plugins', {
|
||||||
|
change_detection = { enabled = false },
|
||||||
|
})
|
||||||
|
|
|
||||||
|
|
@ -118,33 +118,6 @@ return {
|
||||||
{ 'i', mode = { 'x', 'o' } },
|
{ 'i', mode = { 'x', 'o' } },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
'iamcco/markdown-preview.nvim',
|
|
||||||
build = 'pnpm up && cd app && pnpm install',
|
|
||||||
ft = { 'markdown' },
|
|
||||||
config = function()
|
|
||||||
vim.cmd([[
|
|
||||||
function OpenMarkdownPreview(url)
|
|
||||||
exec "silent !$BROWSER -n --args " . a:url
|
|
||||||
endfunction
|
|
||||||
]])
|
|
||||||
vim.g.mkdp_auto_close = 0
|
|
||||||
vim.g.mkdp_browserfunc = 'OpenMarkdownPreview'
|
|
||||||
vim.api.nvim_create_autocmd('FileType', {
|
|
||||||
pattern = 'markdown',
|
|
||||||
callback = function(opts)
|
|
||||||
bmap(
|
|
||||||
{ 'n', '<leader>m', vim.cmd.MarkdownPreviewToggle },
|
|
||||||
{ buffer = opts.buf }
|
|
||||||
)
|
|
||||||
end,
|
|
||||||
group = vim.api.nvim_create_augroup(
|
|
||||||
'AMarkdownKeybind',
|
|
||||||
{ clear = true }
|
|
||||||
),
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
enabled = false,
|
enabled = false,
|
||||||
'lervag/vimtex',
|
'lervag/vimtex',
|
||||||
|
|
|
||||||
|
|
@ -124,8 +124,8 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
pulseaudio = {
|
pulseaudio = {
|
||||||
format = "{icon} {volume}%";
|
format = "{icon} {volume}%";
|
||||||
format-muted = " muted";
|
format-muted = " muted";
|
||||||
format-icons = {
|
format-icons = {
|
||||||
default = [
|
default = [
|
||||||
""
|
""
|
||||||
|
|
@ -269,6 +269,10 @@ in
|
||||||
foreground = c.red;
|
foreground = c.red;
|
||||||
frame_color = c.red;
|
frame_color = c.red;
|
||||||
};
|
};
|
||||||
|
hypr = {
|
||||||
|
appname = "hypr";
|
||||||
|
icon_position = "off";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
xdg.configFile."waybar/themes/midnight.css".text = mkWaybarTheme config.palettes.midnight;
|
xdg.configFile."waybar/themes/midnight.css".text = mkWaybarTheme config.palettes.midnight;
|
||||||
|
|
|
||||||
12
scripts/ctl
12
scripts/ctl
|
|
@ -16,7 +16,7 @@ screenshot)
|
||||||
file="$dir/$(openssl rand -hex 10)-$(date +'%Y-%m-%d_%H-%M-%S').png"
|
file="$dir/$(openssl rand -hex 10)-$(date +'%Y-%m-%d_%H-%M-%S').png"
|
||||||
if [ "${XDG_SESSION_TYPE:-}" = "wayland" ]; then
|
if [ "${XDG_SESSION_TYPE:-}" = "wayland" ]; then
|
||||||
require grim slurp wl-copy
|
require grim slurp wl-copy
|
||||||
grim -g "$(slurp)" "$file" && wl-copy <"$file"
|
grim -g "$(slurp)" "$file" && wl-copy < "$file"
|
||||||
else
|
else
|
||||||
require maim xclip
|
require maim xclip
|
||||||
maim -s "$file" && xclip -selection clipboard -t image/png -i "$file" &
|
maim -s "$file" && xclip -selection clipboard -t image/png -i "$file" &
|
||||||
|
|
@ -33,13 +33,13 @@ ocr)
|
||||||
region="$(slurp)"
|
region="$(slurp)"
|
||||||
[ -n "$region" ] || exit 0
|
[ -n "$region" ] || exit 0
|
||||||
grim -g "$region" "$file" &&
|
grim -g "$region" "$file" &&
|
||||||
tesseract -l eng "$file" - 2>/dev/null | wl-copy
|
tesseract -l eng "$file" - 2>/dev/null | wl-copy
|
||||||
) </dev/null >/dev/null 2>&1 &
|
) </dev/null >/dev/null 2>&1 &
|
||||||
else
|
else
|
||||||
require maim xclip
|
require maim xclip
|
||||||
(
|
(
|
||||||
maim -s "$file" &&
|
maim -s "$file" &&
|
||||||
tesseract -l eng "$file" - 2>/dev/null | xclip -selection clipboard -in
|
tesseract -l eng "$file" - 2>/dev/null | xclip -selection clipboard -in
|
||||||
) </dev/null >/dev/null 2>&1 &
|
) </dev/null >/dev/null 2>&1 &
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
@ -104,9 +104,9 @@ power)
|
||||||
require fuzzel
|
require fuzzel
|
||||||
lock=" Lock"
|
lock=" Lock"
|
||||||
suspend=" Suspend"
|
suspend=" Suspend"
|
||||||
logout=" Logout"
|
logout=" Logout"
|
||||||
reboot=" Reboot"
|
reboot=" Reboot"
|
||||||
shutdown=" Shutdown"
|
shutdown=" Shutdown"
|
||||||
chosen="$(printf '%s\n' "$lock" "$suspend" "$logout" "$reboot" "$shutdown" | fuzzel --dmenu --hide-prompt --lines=5 --width=20 --no-icons)"
|
chosen="$(printf '%s\n' "$lock" "$suspend" "$logout" "$reboot" "$shutdown" | fuzzel --dmenu --hide-prompt --lines=5 --width=20 --no-icons)"
|
||||||
case "$chosen" in
|
case "$chosen" in
|
||||||
"$lock") hyprlock ;;
|
"$lock") hyprlock ;;
|
||||||
|
|
|
||||||
37
scripts/hypr
37
scripts/hypr
|
|
@ -49,21 +49,18 @@ exit)
|
||||||
brightness)
|
brightness)
|
||||||
require brightnessctl notify-send
|
require brightnessctl notify-send
|
||||||
BRIGHT_STEP=5
|
BRIGHT_STEP=5
|
||||||
max_brightness="$(brightnessctl max)"
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
up)
|
up) brightnessctl set "$BRIGHT_STEP"%+ ;;
|
||||||
brightnessctl set "$BRIGHT_STEP"%+
|
down) brightnessctl set "$BRIGHT_STEP"%- ;;
|
||||||
notify-send -t 2500 -r 5555 "brightness $(brightnessctl get | awk -v max="$max_brightness" '{printf "%d%%", $1*100/max}')"
|
*) echo "Invalid subcommand: $1" >&2; exit 1 ;;
|
||||||
;;
|
|
||||||
down)
|
|
||||||
brightnessctl set "$BRIGHT_STEP"%-
|
|
||||||
notify-send -t 2500 -r 5555 "brightness $(brightnessctl get | awk -v max="$max_brightness" '{printf "%d%%", $1*100/max}')"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Invalid subcommand: $1" >&2
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
pct=$(awk -v cur="$(brightnessctl get)" -v max="$(brightnessctl max)" 'BEGIN { printf "%d", cur * 100 / max }')
|
||||||
|
filled=$((pct / 5))
|
||||||
|
empty=$((20 - filled))
|
||||||
|
bar=""
|
||||||
|
i=0; while [ "$i" -lt "$filled" ]; do bar="${bar}━"; i=$((i + 1)); done
|
||||||
|
i=0; while [ "$i" -lt "$empty" ]; do bar="${bar}─"; i=$((i + 1)); done
|
||||||
|
notify-send -a hypr -t 2500 -r 5555 "☼ $bar"
|
||||||
;;
|
;;
|
||||||
volume)
|
volume)
|
||||||
require wpctl notify-send
|
require wpctl notify-send
|
||||||
|
|
@ -88,11 +85,21 @@ volume)
|
||||||
esac
|
esac
|
||||||
|
|
||||||
vol=$(get_vol)
|
vol=$(get_vol)
|
||||||
|
filled=$((vol / 5))
|
||||||
|
empty=$((20 - filled))
|
||||||
|
bar=""
|
||||||
|
i=0; while [ "$i" -lt "$filled" ]; do bar="${bar}━"; i=$((i + 1)); done
|
||||||
|
i=0; while [ "$i" -lt "$empty" ]; do bar="${bar}─"; i=$((i + 1)); done
|
||||||
if wpctl get-volume "$SINK" | grep -q MUTED; then
|
if wpctl get-volume "$SINK" | grep -q MUTED; then
|
||||||
notify-send -t 2500 -r 5556 "volume: ${vol}% (muted)"
|
icon=""
|
||||||
|
elif [ "$vol" -le 33 ]; then
|
||||||
|
icon=""
|
||||||
|
elif [ "$vol" -le 66 ]; then
|
||||||
|
icon=""
|
||||||
else
|
else
|
||||||
notify-send -t 2500 -r 5556 "volume: ${vol}%"
|
icon=""
|
||||||
fi
|
fi
|
||||||
|
notify-send -a hypr -t 2500 -r 5556 "$icon $bar"
|
||||||
;;
|
;;
|
||||||
pull)
|
pull)
|
||||||
require hyprctl jq fuzzel
|
require hyprctl jq fuzzel
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue