From d340bd00d7cf72bafca3c0a42cf54addb2c730d5 Mon Sep 17 00:00:00 2001 From: yutent Date: Mon, 10 Jul 2023 02:48:18 +0000 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- home/config/bspwm/bspwmrc | 6 +++--- home/config/polybar/modules/power.ini | 2 +- home/local/bin/scripts/polybar.sh | 7 ------- home/local/bin/scripts/{confirm.sh => rofi_confirm.sh} | 0 home/local/bin/scripts/rofi_password.sh | 3 +++ .../bin/scripts/{powermenu.sh => rofi_powermenu.sh} | 10 +++++++--- 6 files changed, 14 insertions(+), 14 deletions(-) delete mode 100755 home/local/bin/scripts/polybar.sh rename home/local/bin/scripts/{confirm.sh => rofi_confirm.sh} (100%) create mode 100644 home/local/bin/scripts/rofi_password.sh rename home/local/bin/scripts/{powermenu.sh => rofi_powermenu.sh} (81%) diff --git a/home/config/bspwm/bspwmrc b/home/config/bspwm/bspwmrc index 936a72b..43a11d5 100644 --- a/home/config/bspwm/bspwmrc +++ b/home/config/bspwm/bspwmrc @@ -35,7 +35,7 @@ xrandr --output HDMI-2 --mode 1920x1080 --rate 60 --right-of HDMI-1 --mode 1920x # 干掉已经运行的进程 -killall -9 sxhkd picom nm-applet dunst xsettingsd +killall -9 sxhkd picom nm-applet dunst xsettingsd polybar # 2个显示器, 左显示器配置4个工作区, 右显示器只配置1个工作区 bspc monitor HDMI-1 -d I II III IV @@ -79,8 +79,8 @@ xsetroot -cursor_name left_ptr # 设置系统主题 xsettingsd & -~/.local/bin/scripts/polybar.sh - +# 启动配套的服务 +polybar main -r & sxhkd & nm-applet & dunst & diff --git a/home/config/polybar/modules/power.ini b/home/config/polybar/modules/power.ini index 3ef7e1d..ec8cccc 100644 --- a/home/config/polybar/modules/power.ini +++ b/home/config/polybar/modules/power.ini @@ -6,4 +6,4 @@ content = %{T9}襤%{T-} content-foreground = ${color.red} content-padding = 2 -click-left = ~/.local/bin/scripts/powermenu.sh \ No newline at end of file +click-left = ~/.local/bin/scripts/rofi_powermenu.sh \ No newline at end of file diff --git a/home/local/bin/scripts/polybar.sh b/home/local/bin/scripts/polybar.sh deleted file mode 100755 index 98612dd..0000000 --- a/home/local/bin/scripts/polybar.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# 干掉旧进程 -killall -9 polybar -# 等待1秒再启动新的 -sleep 1 -polybar main -r & diff --git a/home/local/bin/scripts/confirm.sh b/home/local/bin/scripts/rofi_confirm.sh similarity index 100% rename from home/local/bin/scripts/confirm.sh rename to home/local/bin/scripts/rofi_confirm.sh diff --git a/home/local/bin/scripts/rofi_password.sh b/home/local/bin/scripts/rofi_password.sh new file mode 100644 index 0000000..d88f923 --- /dev/null +++ b/home/local/bin/scripts/rofi_password.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +rofi -dmenu -password -i -p "Enter your password" -theme password diff --git a/home/local/bin/scripts/powermenu.sh b/home/local/bin/scripts/rofi_powermenu.sh similarity index 81% rename from home/local/bin/scripts/powermenu.sh rename to home/local/bin/scripts/rofi_powermenu.sh index b31702c..ef76cbd 100644 --- a/home/local/bin/scripts/powermenu.sh +++ b/home/local/bin/scripts/rofi_powermenu.sh @@ -19,7 +19,7 @@ rofi_powermenu() { confirm_run () { - selected="$(~/.local/bin/scripts/confirm.sh)" + selected="$(~/.local/bin/scripts/rofi_confirm.sh)" if [[ "$selected" == "$yes" ]]; then ${1} @@ -29,9 +29,13 @@ confirm_run () { } xlock () { - ~/.local/bin/scripts/xlock --lock + ~/.local/bin/scripts/xlock.sh --lock } +hibernate () { + xlock + systemctl hibernate +} chosen="$(rofi_powermenu)" @@ -43,7 +47,7 @@ case ${chosen} in confirm_run 'bspc quit' ;; $option_3) - confirm_run 'xlock && systemctl hibernate' + confirm_run 'hibernate' ;; $option_4) confirm_run 'systemctl reboot'