]> gitweb.fluxo.info Git - rhatto/dotfiles/xsession.git/commitdiff
Fix: use HOSTNAME and FQDN variables
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 3 Aug 2024 00:39:08 +0000 (21:39 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 3 Aug 2024 00:39:08 +0000 (21:39 -0300)
xsessionrc.dot.link

index df2ec030d35ac4c4915a94aa2ee0e11dfa687a0c..9a3c53c093d8f410af5cb2487dc7e80cbec6a0fc 100755 (executable)
@@ -13,7 +13,8 @@ PROGRAMS="xconky blueman-applet xnm-tray pasystray"
 OSVERSION="`cut -d . -f 1 /etc/debian_version`"
 
 # Hostname
-HOSTNAME="`cat /etc/hostname`"
+HOSTNAME="`cat /etc/hostname | cut -d . -f 1`"
+FQDN="`cat /etc/hostname`"
 
 # Output
 # Example: OUTPUT="VGA-1"
@@ -110,21 +111,21 @@ if [ -f "$HOME/.Xmodmap" ]; then
 fi
 
 # Apply custom keyboard configuration
-if [ -f "$HOME/.Xmodmaps/$HOSTNAME" ]; then
-  xmodmap $HOME/.Xmodmaps/$HOSTNAME
+if [ -f "$HOME/.Xmodmaps/$FQDN" ]; then
+  xmodmap $HOME/.Xmodmaps/$FQDN
 
   # Why xmodmap has to run twice to some changes take place?
   # https://faq.i3wm.org/question/558/xmodmap-loading/
   # https://bugs.launchpad.net/ubuntu/+source/gdm/+bug/700309
-  xmodmap $HOME/.Xmodmaps/$HOSTNAME
+  xmodmap $HOME/.Xmodmaps/$FQDN
 fi
 
 # Fix mumble configuration, which varies depending on machine audio
-if [ -f "$HOME/.config/Mumble/Mumble-$HOSTNAME.conf" ]; then
+if [ -f "$HOME/.config/Mumble/Mumble-$FQDN.conf" ]; then
   (
     cd $HOME/.config/Mumble
-    mv Mumble.conf Mumble-$HOSTNAME.conf.backup
-    ln -s Mumble-$HOSTNAME.conf Mumble.conf
+    mv Mumble.conf Mumble-$FQDN.conf.backup
+    ln -s Mumble-$FQDN.conf Mumble.conf
   )
 fi