aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2022-12-17 09:34:36 +0800
committerGuangxiong Lin <[email protected]>2022-12-17 09:34:36 +0800
commit885cbb18b6c9df2b0c4f77a7b7956125c4f08473 (patch)
treeda5243f872e2ec2e5cf85693416917c4083d9b21
parent449208367563b5b7e9e06cffc719e2500731ce7c (diff)
downloaddotfiles-885cbb18b6c9df2b0c4f77a7b7956125c4f08473.tar.gz
dotfiles-885cbb18b6c9df2b0c4f77a7b7956125c4f08473.tar.bz2
dotfiles-885cbb18b6c9df2b0c4f77a7b7956125c4f08473.zip
Update swaywm start config
-rw-r--r--.config/sway/config4
-rwxr-xr-xbin/autostart16
-rwxr-xr-xbin/autostart-wayland17
-rwxr-xr-xbin/startsway6
4 files changed, 18 insertions, 25 deletions
diff --git a/.config/sway/config b/.config/sway/config
index 7311480..13c7fce 100644
--- a/.config/sway/config
+++ b/.config/sway/config
@@ -14,7 +14,6 @@ set $down j
set $up k
set $right l
# Your preferred terminal emulator
-# set $term foot
set $term st
# Your preferred application launcher
# Note: pass the final command to swaymsg so that the resulting window can be opened
@@ -249,3 +248,6 @@ for_window [class="Steam"] floating enable
#
include /etc/sway/config.d/*
+
+# Autostart
+exec --no-startup-id autostart
diff --git a/bin/autostart b/bin/autostart
index ac4bc3a..6fb5da2 100755
--- a/bin/autostart
+++ b/bin/autostart
@@ -1,11 +1,23 @@
#!/usr/bin/env bash
[ -f /usr/bin/fcitx5 ] && fcitx5 -d
-[ -f ~/.fehbg ] && ~/.fehbg &
[ -f /usr/bin/dunst ] && dunst &
-[ -f /usr/bin/udiskie ] && udiskie -a -n -s &
+[ -f /usr/bin/udiskie ] && udiskie -a -n -s --appindicator &
[ -f /usr/bin/clipmenud ] && clipmenud &
+if [ "$XDG_SESSION_TYPE" = x11 ]; then
+ [ -f ~/.fehbg ] && ~/.fehbg &
+fi
+
+if [ "$XDG_SESSION_TYPE" = wayland ]; then
+ command -v gammastep > /dev/null && \
+ command -v awk > /dev/null && \
+ command -v tr > /dev/null && \
+ gammastep \
+ -l $(curl -s "https://location.services.mozilla.com/v1/geolocate?key=geoclue" | awk 'OFS=":" {print $3,$5}' | tr -d ',}') \
+ -m wayland
+fi
+
[ -x "$HOME/.local/autostart" ] && "$HOME/.local/autostart"
diff --git a/bin/autostart-wayland b/bin/autostart-wayland
deleted file mode 100755
index d74ecb0..0000000
--- a/bin/autostart-wayland
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env bash
-
-[ -f /usr/bin/fcitx5 ] && fcitx5 -d
-
-[ -f /usr/bin/dunst ] && dunst &
-[ -f /usr/bin/udiskie ] && udiskie -a -n -s --appindicator &
-
-[ -f /usr/bin/clipmenud ] && clipmenud &
-
-command -v gammastep > /dev/null && \
- command -v awk > /dev/null && \
- command -v tr > /dev/null && \
- gammastep \
- -l $(curl -s "https://location.services.mozilla.com/v1/geolocate?key=geoclue" | awk 'OFS=":" {print $3,$5}' | tr -d ',}') \
- -m wayland
-
-[ -x "$HOME/.local/autostart" ] && "$HOME/.local/autostart"
diff --git a/bin/startsway b/bin/startsway
index 812788b..b593354 100755
--- a/bin/startsway
+++ b/bin/startsway
@@ -5,8 +5,4 @@ export XDG_SESSION_DESKTOP=sway
export WLR_RENDER=vulkan
export MOZ_ENABLE_WAYLAND=1
-sway
-
-swaymsg -- exec --no-startup-id autostart-wayland
-
-exit 0
+exec sway