调整polybar的volume;调整电源按钮的事件

master
yutent 2023-07-07 07:31:10 +00:00
parent acc97d69ad
commit 177fd4f406
4 changed files with 42 additions and 23 deletions

View File

@ -1,18 +1,23 @@
# wm-logs
记录`debian bookworm + wm`从0开始配置的历险记。
## 社区源
部分软件只有社区源(`https://repo.izero.im`)里有, debian官方源里并没有。
## 基础安装
```bash
# sudo apt install i3 ly alacritty xserver-xorg picom polybar rofi feh
sudo apt install bspwm ly alacritty xserver-xorg picom polybar rofi feh
sudo apt install bspwm ly i3lock-color alacritty xserver-xorg picom polybar rofi feh
```
- `ly` 一个TUI形式的`display manager`
- ~~`i3` 平铺式窗口管理管理器~~ // 从入门到放弃, 改为用bspwm了
- `bspwm` 另外一个平铺式窗口管理器
- `xserver-xorg` X
- `xserver-xorg` X服务, 也可以装`xorg`包
- `i3lock-color` i3lock的升级版, 支持背景 (需要加社区源, 见上方)
- `picom` 一个轻量的流行的特效合成器
- `polybar` 状态栏
- `rofi` 应用启动器
@ -22,6 +27,14 @@ sudo apt install bspwm ly alacritty xserver-xorg picom polybar rofi feh
## 配套
```bash
# 字体 (需要要加社区源)
# 这2个官方源里就有
sudo apt install fonts-noto-cjk fonts-noto-color-emoji
# 这几个在社区源里
sudo apt install fonts-harmony-os-sans fonts-material-icons fonts-menlo fonts-raleway fonts-symbols-nerd-font
# 音频相关
## sudo apt install pavucontrol pulseaudio
sudo apt install pipewire

View File

@ -11,6 +11,7 @@ include-file = ./modules.ini
[bar/main]
;override-redirect = true
owm-restack = genery
;owm-restack = bspwm
;locale = zh_CN.UTF-8
@ -40,7 +41,7 @@ fixed-center = true
modules-left = logo workspace pipe-db mpd
modules-center = date
modules-right = netspeed volume pipe power
modules-right = netspeed pipe volume pipe power
tray-position = right
@ -49,6 +50,7 @@ tray-padding = 5
tray-detached = false
tray-background = ${color.background}
tray-scale = 1.0
pseudo-transparency = true
enable-ipc = true

View File

@ -11,7 +11,8 @@ use-ui-max = false
; 音量显示格式
format-volume = <ramp-volume> <bar-volume>
; 可用标签 <bar-volume> 音量条
format-volume = <ramp-volume> <label-volume>
format-volume-background = ${color.background}
format-volume-padding = 1
@ -28,24 +29,24 @@ label-muted = " "
label-muted-foreground = ${color.altforeground}
; 音量条
bar-volume-width = 5
bar-volume-gradient = false
;bar-volume-width = 5
;bar-volume-gradient = false
bar-volume-indicator =
bar-volume-indicator-font = 2
bar-volume-indicator-foreground = ${color.blue}
;bar-volume-indicator =
;bar-volume-indicator-font = 2
;bar-volume-indicator-foreground = ${color.blue}
bar-volume-fill =
bar-volume-fill-font = 3
bar-volume-foreground-0 = ${color.blue}
bar-volume-foreground-1 = ${color.blue}
bar-volume-foreground-2 = ${color.blue}
bar-volume-foreground-3 = ${color.blue}
bar-volume-foreground-4 = ${color.blue}
;bar-volume-fill =
;bar-volume-fill-font = 3
;bar-volume-foreground-0 = ${color.blue}
;bar-volume-foreground-1 = ${color.blue}
;bar-volume-foreground-2 = ${color.blue}
;bar-volume-foreground-3 = ${color.blue}
;bar-volume-foreground-4 = ${color.blue}
bar-volume-empty =
bar-volume-empty-font = 3
bar-volume-empty-foreground = ${color.altbackground}
;bar-volume-empty =
;bar-volume-empty-font = 3
;bar-volume-empty-foreground = ${color.altbackground}
; 根据音量变换图标
ramp-volume-0 =

View File

@ -1,6 +1,6 @@
#!/bin/bash
prompt="Are you sure?"
prompt="Select the action..."
mesg="Uptime : `uptime -p | sed -e 's/up //g'`"
option_1=""
@ -24,23 +24,26 @@ confirm_run () {
if [[ "$selected" == "$yes" ]]; then
${1}
else
echo $selected, $1
exit
fi
}
xlock () {
~/.local/bin/scripts/xlock --lock
}
chosen="$(rofi_powermenu)"
case ${chosen} in
$option_1)
xscreensaver-command --lock
xlock
;;
$option_2)
confirm_run 'bspc quit'
;;
$option_3)
confirm_run 'xscreensaver-command --lock && systemctl hibernate'
confirm_run 'xlock && systemctl hibernate'
;;
$option_4)
confirm_run 'systemctl reboot'