Configure Bash script format rules
This commit is contained in:
20
.editorconfig
Normal file
20
.editorconfig
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
[*.sh]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
# --language-variant
|
||||||
|
shell_variant = posix
|
||||||
|
binary_next_line = true
|
||||||
|
# --case-indent
|
||||||
|
switch_case_indent = true
|
||||||
|
space_redirects = true
|
||||||
|
keep_padding = true
|
||||||
|
# --func-next-line
|
||||||
|
function_next_line = true
|
||||||
|
|
||||||
|
# Ignore the entire "third_party" directory when calling shfmt on directories,
|
||||||
|
# such as "shfmt -l -w .". When formatting files directly,
|
||||||
|
# like "shfmt -w third_party/foo.sh" or "shfmt --filename=third_party/foo.sh",
|
||||||
|
# the ignore logic is applied only when the --apply-ignore flag is given.
|
||||||
|
[third_party/**]
|
||||||
|
ignore = true
|
||||||
@@ -1,54 +1,54 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then
|
if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then
|
||||||
if [ -n "$DBUS_SESSION_BUS_ADDRESS" ]; then
|
if [ -n "$DBUS_SESSION_BUS_ADDRESS" ]; then
|
||||||
# XDG Settings Basic
|
# XDG Settings Basic
|
||||||
export XDG_CONFIG_HOME=${HOME}/.config
|
export XDG_CONFIG_HOME=${HOME}/.config
|
||||||
export XDG_DATA_HOME=${HOME}/.local/share
|
export XDG_DATA_HOME=${HOME}/.local/share
|
||||||
export XDG_CACHE_HOME=${HOME}/.local/cache
|
export XDG_CACHE_HOME=${HOME}/.local/cache
|
||||||
export XDG_STATE_HOME=${HOME}/.local/state
|
export XDG_STATE_HOME=${HOME}/.local/state
|
||||||
|
|
||||||
# XDG_CONFIG_HOME
|
# XDG_CONFIG_HOME
|
||||||
export GTK2_RC_FILES=${XDG_CONFIG_HOME}/gtk-2.0/gtkrc-2.0
|
export GTK2_RC_FILES=${XDG_CONFIG_HOME}/gtk-2.0/gtkrc-2.0
|
||||||
|
|
||||||
# Reduces crashs for some gdk apps, like evolution
|
# Reduces crashs for some gdk apps, like evolution
|
||||||
# ! Do not set as global variable. Electron Apps will not start !
|
# ! Do not set as global variable. Electron Apps will not start !
|
||||||
# export GDK_BACKEND=wayland
|
# export GDK_BACKEND=wayland
|
||||||
|
|
||||||
# Required for tray icons on waybar
|
# Required for tray icons on waybar
|
||||||
export XDG_CURRENT_DESKTOP=sway
|
export XDG_CURRENT_DESKTOP=sway
|
||||||
|
|
||||||
# Enable QT apps to have gtk theme
|
# Enable QT apps to have gtk theme
|
||||||
export QT_QPA_PLATFORMTHEME=qt5ct
|
export QT_QPA_PLATFORMTHEME=qt5ct
|
||||||
|
|
||||||
# Force wayland on qt apps
|
# Force wayland on qt apps
|
||||||
export QT_QPA_PLATFORM=wayland
|
export QT_QPA_PLATFORM=wayland
|
||||||
|
|
||||||
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
|
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
|
||||||
# Explicitly set to '96' instead of 'physical' because some apps have problems
|
# Explicitly set to '96' instead of 'physical' because some apps have problems
|
||||||
# Looking at you nextcloud client!
|
# Looking at you nextcloud client!
|
||||||
# https://github.com/nextcloud/desktop/issues/1079
|
# https://github.com/nextcloud/desktop/issues/1079
|
||||||
# https://github.com/swaywm/sway/issues/2424
|
# https://github.com/swaywm/sway/issues/2424
|
||||||
export QT_WAYLAND_FORCE_DPI=96
|
export QT_WAYLAND_FORCE_DPI=96
|
||||||
|
|
||||||
# Make Qt apps honour DPI settings.
|
# Make Qt apps honour DPI settings.
|
||||||
export QT_AUTO_SCREEN_SCALE_FACTOR=1
|
export QT_AUTO_SCREEN_SCALE_FACTOR=1
|
||||||
|
|
||||||
# Mozilla Wayland support + hardware video decoding
|
# Mozilla Wayland support + hardware video decoding
|
||||||
export MOZ_ENABLE_WAYLAND=1
|
export MOZ_ENABLE_WAYLAND=1
|
||||||
export MOZ_WAYLAND_USE_VAAPI=1
|
export MOZ_WAYLAND_USE_VAAPI=1
|
||||||
|
|
||||||
# SDL
|
# SDL
|
||||||
export SDL_VIDEODRIVER=wayland
|
export SDL_VIDEODRIVER=wayland
|
||||||
|
|
||||||
# Java under Xwayland
|
# Java under Xwayland
|
||||||
export _JAVA_AWT_WM_NONREPARENTING=1
|
export _JAVA_AWT_WM_NONREPARENTING=1
|
||||||
|
|
||||||
# Session Type for later screensharing
|
# Session Type for later screensharing
|
||||||
export XDG_SESSION_TYPE=wayland
|
export XDG_SESSION_TYPE=wayland
|
||||||
|
|
||||||
exec dbus-launch --exit-with-session sway
|
exec dbus-launch --exit-with-session sway
|
||||||
else
|
else
|
||||||
echo "Cannot found dbus session: Sway don't work"
|
echo "Cannot found dbus session: Sway don't work"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user