modify file

This commit is contained in:
alex 2025-08-01 01:26:56 +08:00
parent c486281b35
commit 534b75605b
3 changed files with 23 additions and 17 deletions

View file

@ -23,12 +23,3 @@ map k up
map l open
map h updir
# 预览文本/图片/归档
cmd pv %{{
case "$(file -Lb --mime-type "$1")" in
text/*) bat --paging=never --color=always "$1" ;;
image/*) chafa -c 256 -s 80x25 "$1" ;;
application/zip|application/x-tar) atool -l "$1" ;;
*) file -b "$1" ;;
esac
}}

View file

@ -1,6 +1,9 @@
#!/bin/sh
case "$(file -Lb --mime-type "$1")" in
text/*|application/json|application/xml) bat --color=always --paging=never "$1" ;;
image/*) chafa -c 256 -s "$2"x"$3" "$1" ;;
*) file -b "$1" ;;
esac
cmd pv %{{
case "$(file -Lb --mime-type "$1")" in
text/*) bat --paging=never --color=always "$1" ;;
image/*) feh "$1";;
application/zip|application/x-tar) atool -l "$1" ;;
*) file -b "$1" ;;
esac
}}

View file

@ -31,13 +31,17 @@ height = 20pt
radius = 6
; dpi = 96
; 关闭默认的背景色和文本或其他元素的前景色
;background = ${colors.background}
;foreground = ${colors.foreground}
background = #80222222
;foreground = #90a333
; 设置背景透明
background = #80222222
; 隐藏分隔线,使得 Polybar 的模块之间没有分隔线,看起来更加紧凑。
line-size = 0pt
; 关闭polybar的默认留空宽度
border-size = 0
border-color = #00000000
@ -49,10 +53,12 @@ module-margin = 1
separator = |
separator-foreground = ${colors.disabled}
; 多字体支持让polybar更好显示中文、emoji等多种字体
font-0 = Sarasa Term SC Nerd:bold:italic:siza=10;2
font-1 = MesloLGM Nerd Font Mono:bold:size=10;2
;font-1 = Maple Mono Normal CN:size=10;2
font-2 = Maple Mono Normal CN:size=10;2
; 设定要显示的模块
modules-left = xworkspaces
modules-right = netrate volume memory cpu battery date
@ -88,15 +94,18 @@ label-active = %name%
label-active-background = ${colors.background-alt}
label-active-underline= ${colors.primary}
label-active-padding = 1
; 当前活动工作区或标签的文本颜色
label-active-foreground = #0afaee
label-occupied = %name%
label-occupied-padding = 1
; 设置被占用但未激活的工作区或标签的文本颜色
label-occupied-foreground = #6487b4
label-urgent = %name%
label-urgent-background = ${colors.alert}
label-urgent-padding = 1
; 设置紧急工作区或标签的文本颜色
label-urgent-foreground = #ea2e4e
label-empty = %name%
@ -130,6 +139,7 @@ label = %title:0:60:...%
;label-muted = muted
;label-muted-foreground = ${colors.disabled}
; 自定义的网络信息显示模块,加载自己编写获取本机网络信息的脚本
[module/netrate]
type = custom/script
exec = ~/.config/polybar/netrate.sh
@ -139,6 +149,7 @@ format-prefix-foreground = ${colors.primary}
label = %output%
label-foreground = #7e9d7b
; 自定义的声音音量信息显示模块,加载自己编写获得本机声音音量信息的脚本
[module/volume]
type = custom/script
exec = ~/.config/polybar/sndio.sh
@ -185,6 +196,7 @@ label-foreground = #7e9d7b
;format = <label>
;label = %output%
; 自定义的电池电量信息显示模块,加载自己编写获得本机电池电量信息的脚本
[module/battery]
type = custom/script
exec = ~/.config/polybar/battery.sh