From b8b09ad80c1f292106004d449926133bacd9f100 Mon Sep 17 00:00:00 2001 From: Alessandro Mauri Date: Mon, 6 Apr 2020 19:27:08 +0200 Subject: [PATCH] Changed setting xdg user dirs with xdg-user-dirs Setting the user dirs manually can cause gtk file explorer dialogs to not open correctly freezing applications that try to use it. Firefox had this behaviour after having installed and removed flatpak adn dependencies which included xdg-user-dirs, strange because it worked before without it. It is worth noting that this error does not give any hints or error message, moreover the gui remains active but unresponding I found out what caused the error essentially by chance. --- conf/config/user-dirs.dirs | 15 +++++++ conf/config/user-dirs.locale | 1 + startw | 84 ++++++++++++++++++------------------ 3 files changed, 59 insertions(+), 41 deletions(-) create mode 100644 conf/config/user-dirs.dirs create mode 100644 conf/config/user-dirs.locale diff --git a/conf/config/user-dirs.dirs b/conf/config/user-dirs.dirs new file mode 100644 index 0000000..7f9a959 --- /dev/null +++ b/conf/config/user-dirs.dirs @@ -0,0 +1,15 @@ +# This file is written by xdg-user-dirs-update +# If you want to change or add directories, just edit the line you're +# interested in. All local changes will be retained on the next run. +# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped +# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an +# absolute path. No other format is supported. +# +XDG_DESKTOP_DIR="$HOME/Desktop" +XDG_DOWNLOAD_DIR="$HOME/Downloads" +XDG_TEMPLATES_DIR="$HOME/Templates" +XDG_PUBLICSHARE_DIR="$HOME/Public" +XDG_DOCUMENTS_DIR="$HOME/Documents" +XDG_MUSIC_DIR="$HOME/Music" +XDG_PICTURES_DIR="$HOME/Pictures" +XDG_VIDEOS_DIR="$HOME/Videos" diff --git a/conf/config/user-dirs.locale b/conf/config/user-dirs.locale new file mode 100644 index 0000000..3e0b419 --- /dev/null +++ b/conf/config/user-dirs.locale @@ -0,0 +1 @@ +en_US \ No newline at end of file diff --git a/startw b/startw index 6e5b40d..cb75e07 100755 --- a/startw +++ b/startw @@ -29,19 +29,48 @@ then "$STARTW_ROOT"/addts >> "$STARTW_LOG_FILE" & fi +# +# APPLY USER CONFIG +# + +# The conf folder contains two subfolders home +# and config, everything in the home folder will +# be symlinked to $HOME as a hidden file/folder, +# whereas everything in the config folder will be +# symlinked to $HOME/.config as-is +# Dotfiles in these folder will be ignored + +for f in "$DOTS_ROOT"/home/* ; do + # If the filename already exists and it is not a link override it + if [ -e "$HOME/.$(basename "$f")" ]; then + if [ ! -L "$HOME/.$(basename "$f")" ]; then + rm -rf "$HOME/.$(basename "$f")" + fi + fi + ln -sf "$f" "$HOME/.$(basename "$f")" +done + +for f in "$DOTS_ROOT"/config/* ; do + # If the filename already exists and it is not a link override it + if [ -e "$HOME/.config/$(basename "$f")" ]; then + if [ ! -L "$HOME/.config/$(basename "$f")" ]; then + rm -rf "$HOME/.config/$(basename "$f")" + fi + fi + ln -sf "$f" "$HOME/.config/" +done + # # SET ENVIRONMENT VARIABLES # # Enable wayland native support export _JAVA_AWT_WM_NONREPARENTING=1 -export MOZ_ENABLE_WAYLAND=1 +#export MOZ_ENABLE_WAYLAND=1 export SDL_VIDEODRIVER=wayland export QT_QPA_PLATFORM=wayland-egl export QT_WAYLAND_FORCE_DPI=physical export BEMENU_BACKEND=wayland -# Do NOT uncomment this, breaks stuff -# export GDK_BACKEND=wayland # Set the hardware acceleration driver export LIBVA_DRIVER_NAME=vdpau # Set the default interface used by wpa_cli @@ -56,14 +85,7 @@ export XDG_CURRENT_DESKTOP=Unity export XDG_DATA_HOME=$HOME/.local/share export XDG_CACHE_HOME=$HOME/.cache export XDG_CONFIG_HOME=$HOME/.config -export XDG_DESKTOP_DIR="$HOME/Desktop" -export XDG_DOCUMENTS_DIR="$HOME/Documents" -export XDG_DOWNLOAD_DIR="$HOME/Downloads" -export XDG_MUSIC_DIR="$HOME/Music" -export XDG_PICTURES_DIR="$HOME/Pictures" -export XDG_PUBLICSHARE_DIR="$HOME/Public" -export XDG_TEMPLATES_DIR="$HOME/Templates" -export XDG_VIDEOS_DIR="$HOME/Videos" +xdg-user-dirs & # Clean home directory export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc export ATOM_HOME="$XDG_DATA_HOME"/atom @@ -72,36 +94,16 @@ export CARGO_HOME="$XDG_DATA_HOME"/cargo # Set user script dir export SCRIPT_DIR="$XDG_CONFIG_HOME"/scripts -# -# APPLY USER CONFIG -# - -# The conf folder contains two subfolders home -# and config, everything in the home folder will -# be symlinked to $HOME as a hidden file/folder, -# whereas everything in the config folder will be -# symlinked to $HOME/.config as-is -# Dotfiles in these folder will be ignored - -for f in "$DOTS_ROOT"/home/* ; do - # If the filename already exists and it is not a link override it - if [ -e "$HOME/.$(basename "$f")" ]; then - if [ ! -L "$HOME/.$(basename "$f")" ]; then - rm -rf "$HOME/.$(basename "$f")" - fi - fi - ln -sf "$f" "$HOME/.$(basename "$f")" -done - -for f in "$DOTS_ROOT"/config/* ; do - # If the filename already exists and it is not a link override it - if [ -e "$HOME/.config/$(basename "$f")" ]; then - if [ ! -L "$HOME/.config/$(basename "$f")" ]; then - rm -rf "$HOME/.config/$(basename "$f")" - fi - fi - ln -sf "$f" "$HOME/.config/" -done +# Do NOT uncomment this, breaks stuff +# export GDK_BACKEND=wayland +# export XDG_DESKTOP_DIR="$HOME/Desktop" +# export XDG_DOCUMENTS_DIR="$HOME/Documents" +# export XDG_DOWNLOAD_DIR="$HOME/Downloads" +# export XDG_MUSIC_DIR="$HOME/Music" +# export XDG_PICTURES_DIR="$HOME/Pictures" +# export XDG_PUBLICSHARE_DIR="$HOME/Public" +# export XDG_TEMPLATES_DIR="$HOME/Templates" +# export XDG_VIDEOS_DIR="$HOME/Videos" # # LAUNCH APPLICATIONS