From 12bcba518d693ab28dd69c12d3d9340b4e93e84f Mon Sep 17 00:00:00 2001 From: jay Date: Mon, 11 Sep 2023 08:20:07 +0800 Subject: [PATCH] update --- home/.chezmoi.toml.tmpl | 4 ++++ home/dot_config/sway/config | 23 ++++++++++--------- ...power.sh => executable_wofi-power.sh.tmpl} | 8 ++++--- 3 files changed, 21 insertions(+), 14 deletions(-) rename home/dot_config/wofi/{executable_wofi-power.sh => executable_wofi-power.sh.tmpl} (64%) diff --git a/home/.chezmoi.toml.tmpl b/home/.chezmoi.toml.tmpl index 2e31269..77d606c 100644 --- a/home/.chezmoi.toml.tmpl +++ b/home/.chezmoi.toml.tmpl @@ -28,6 +28,10 @@ {{- $enableTmux := promptBoolOnce . "enableTmux" "install enable tmux autostart" true -}} {{- $enableSSHAgent := promptBoolOnce . "enableSSHAgent" "install enable ssh agent autostart" true -}} {{- $enableUI := promptBoolOnce . "enableUI" "install enable ui" true -}} +{{- $systemd := promptBoolOnce . "systemd" "is systemd init" true -}} + +[data.settings] + systemd = {{ $systemd }} [data.ui] enable = {{ $enableUI }} diff --git a/home/dot_config/sway/config b/home/dot_config/sway/config index bb87a51..10298b8 100644 --- a/home/dot_config/sway/config +++ b/home/dot_config/sway/config @@ -38,7 +38,7 @@ output * bg /home/jay/.config/sway/bg.png fill exec --no-startup-id dbus-update-activation-environment --all # exec_always xdg-desktop-portal -r -exec_always /usr/libexec/xdg-desktop-portal-wlr +# exec_always /usr/libexec/xdg-desktop-portal-wlr # exec env XDG_CONFIG_HOME=/home/jay/.config gentoo-pipewire-launcher restart & exec_always kanshi exec dex -a -e sway @@ -246,16 +246,16 @@ bindsym --release $mod+Shift+w exec "echo 0 > /tmp/sovpipe" bindsym $mod+Ctrl+h exec cat ~/.config/sway/config |grep bindsym |grep -v "#"| sed 's/^[[:space:]]*//'| wofi --dmenu # set workspace monitor -workspace 1 output eDP-1 -workspace 2 output HDMI-A-1 DP-1 eDP-1 -workspace 3 output HDMI-A-1 DP-1 eDP-1 -workspace 4 output HDMI-A-1 DP-1 eDP-1 -workspace 5 output HDMI-A-1 DP-1 eDP-1 -workspace 6 output HDMI-A-1 DP-1 eDP-1 -workspace 7 output eDP-1 -workspace 8 output eDP-1 -workspace 9 output eDP-1 -workspace 10 output eDP-1 +#workspace 1 output eDP-1 +#workspace 2 output HDMI-A-1 DP-1 eDP-1 +#workspace 3 output HDMI-A-1 DP-1 eDP-1 +#workspace 4 output HDMI-A-1 DP-1 eDP-1 +#workspace 5 output HDMI-A-1 DP-1 eDP-1 +#workspace 6 output HDMI-A-1 DP-1 eDP-1 +#workspace 7 output eDP-1 +#workspace 8 output eDP-1 +#workspace 9 output eDP-1 +#workspace 10 output eDP-1 # # Status Bar: @@ -290,3 +290,4 @@ focus_follows_mouse no xwayland enable # include @sysconfdir@/sway/config.d/* +include ~/.config/sway/conf.d/* diff --git a/home/dot_config/wofi/executable_wofi-power.sh b/home/dot_config/wofi/executable_wofi-power.sh.tmpl similarity index 64% rename from home/dot_config/wofi/executable_wofi-power.sh rename to home/dot_config/wofi/executable_wofi-power.sh.tmpl index 85ceb42..410a309 100644 --- a/home/dot_config/wofi/executable_wofi-power.sh +++ b/home/dot_config/wofi/executable_wofi-power.sh.tmpl @@ -4,13 +4,15 @@ entries="⇠ Logout\n⏾ Suspend\n⭮ Reboot\n⏻ Shutdown" selected=$(echo -e $entries|wofi --width 350 --height 250 --dmenu --cache-file /dev/null | awk '{print tolower($2)}') +cmd="{{- if .settings.systemd }}systemctl{{ else }}loginctl{{ end }}" + case $selected in logout) swaymsg exit;; suspend) - exec loginctl suspend;; + exec ${cmd} suspend;; reboot) - exec loginctl reboot;; + exec ${cmd} reboot;; shutdown) - exec loginctl poweroff -i;; + exec ${cmd} poweroff -i;; esac