[neon/neon/settings/Neon/release_jammy] etc: add various ally and startups scripts borrowed from fedora

Carlos De Maine null at kde.org
Wed Aug 21 03:47:01 BST 2024


Git commit 82f342a75b79a079a085cedc2f31305277823ff6 by Carlos De Maine.
Committed on 21/08/2024 at 02:47.
Pushed by carlosdem into branch 'Neon/release_jammy'.

add various ally and startups scripts borrowed from fedora

(cherry picked from commit 76989b994120c82bf0adc59109d5812d9de62232)

Co-authored-by: Carlos De Maine <carlosdemaine at gmail.com>

A  +21   -0    etc/kde/env/env.sh
A  +38   -0    etc/kde/env/gpg-agent-startup.sh
A  +21   -0    etc/kde/env/gtk2_rc_files.sh
A  +2    -0    etc/profile.d/kde-openssh-askpass.sh
A  +10   -0    etc/profile.d/kde.sh
A  +6    -0    etc/xdg/plasma-workspace/env/at-spi-xwayland.sh
A  +21   -0    etc/xdg/plasma-workspace/env/gtk2_rc_files.sh
A  +7    -0    etc/xdg/plasma-workspace/env/gtk_scrolling.sh
A  +4    -0    etc/xdg/plasma-workspace/env/ssh-agent.sh

https://invent.kde.org/neon/neon/settings/-/commit/82f342a75b79a079a085cedc2f31305277823ff6

diff --git a/etc/kde/env/env.sh b/etc/kde/env/env.sh
new file mode 100644
index 0000000..e2af9c9
--- /dev/null
+++ b/etc/kde/env/env.sh
@@ -0,0 +1,21 @@
+## from http://standards.freedesktop.org/menu-spec/latest/
+
+# XDG_CONFIG_DIRS
+if [ -z "${XDG_CONFIG_DIRS}" ] ; then
+   #XDG_CONFIG_DIRS=/etc/xdg:/usr/share/kde-settings/kde-profile/default/xdg
+   XDG_CONFIG_DIRS=/etc/xdg
+   export XDG_CONFIG_DIRS
+fi
+
+# XDG_DATA_DIRS
+if [ -z "${XDG_DATA_DIRS}" ] ; then
+   #XDG_DATA_DIRS=/usr/share/kde-settings/kde-profile/default/share:/usr/local/share:/usr/share
+   XDG_DATA_DIRS=/usr/local/share:/usr/share
+   export XDG_DATA_DIRS
+fi
+
+# XDG_MENU_PREFIX
+if [ -z "${XDG_MENU_PREFIX}" ] ; then
+   XDG_MENU_PREFIX="kf5-"
+   export XDG_MENU_PREFIX
+fi
\ No newline at end of file
diff --git a/etc/kde/env/gpg-agent-startup.sh b/etc/kde/env/gpg-agent-startup.sh
new file mode 100644
index 0000000..fbeebd2
--- /dev/null
+++ b/etc/kde/env/gpg-agent-startup.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+GPG_AGENT=/usr/bin/gpg-agent
+## Run gpg-agent only if not already running, and available
+if [ -x "${GPG_AGENT}" ] ; then
+
+  # gpg-agent uses ~/.gpg-agent-info by default, but we'll try to use 
+  # XDG_RUNTIME_DIR too for added safety
+  GPG_AGENT_INFO_FILE=${XDG_RUNTIME_DIR:-${HOME}}/.gpg-agent-info
+
+  # check validity of GPG_SOCKET (in case of session crash)
+  if [ -f "${GPG_AGENT_INFO_FILE}" ]; then
+    GPG_AGENT_PID=`cat ${GPG_AGENT_INFO_FILE} | cut -f2 -d:`
+    GPG_PID_NAME=`ps -p ${GPG_AGENT_PID} -o comm=`
+    if [ ! "x${GPG_PID_NAME}" = "xgpg-agent" ]; then
+      rm -f "${GPG_AGENT_INFO_FILE}" 2>&1 >/dev/null
+    else
+       GPG_SOCKET=`cat "${GPG_AGENT_INFO_FILE}" | cut -f1 -d: | cut -f2 -d=`
+       if ! test -S "${GPG_SOCKET}" -a -O "${GPG_SOCKET}" ; then
+         rm -f "${GPG_AGENT_INFO_FILE}" 2>&1 >/dev/null
+       fi
+    fi
+    unset GPG_AGENT_PID GPG_SOCKET GPG_PID_NAME
+  fi
+
+  if [ -f "${GPG_AGENT_INFO_FILE}" ]; then
+    eval "$(cat "${GPG_AGENT_INFO_FILE}")"
+    eval "$(cut -d= -f1 < "${GPG_AGENT_INFO_FILE}" | xargs echo export)"
+    export GPG_TTY=$(tty)
+  else
+    eval "$(${GPG_AGENT} -s --daemon --write-env-file ${GPG_AGENT_INFO_FILE})"
+  fi
+
+  unset GPG_AGENT_INFO_FILE
+
+fi
+
+unset GPG_AGENT
diff --git a/etc/kde/env/gtk2_rc_files.sh b/etc/kde/env/gtk2_rc_files.sh
new file mode 100644
index 0000000..18d9746
--- /dev/null
+++ b/etc/kde/env/gtk2_rc_files.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+GTK2RC_FILE=/usr/share/themes/Adwaita/gtk-2.0/gtkrc
+GTK2RC_KDE4=/usr/share/kde-settings/kde-profile/default/gtkrc-2.0-kde4
+GTK2RC_KDE4_HOME=${HOME}/.gtkrc-2.0-kde4
+
+if [ -f "${GTK2RC_FILE}" -a -f "${GTK2RC_KDE4}" -a ! -f "${GTK2RC_KDE4_HOME}" ]; then
+  install -m644 -p "${GTK2RC_KDE4}" "${GTK2RC_KDE4_HOME}"
+fi
+
+if [ -f "${GTK2RC_KDE4_HOME}" ];then
+  if [ -z "${GTK2_RC_FILES}" ]; then
+    GTK2_RC_FILES=${GTK2RC_KDE4_HOME}
+  elif ! echo ${GTK2_RC_FILES} | /bin/grep -q ${GTK2RC_KDE4_HOME} ; then
+    GTK2_RC_FILES=${GTK2_RC_FILES}:${GTK2RC_KDE4_HOME}
+  fi
+  export GTK2_RC_FILES
+fi
+
+unset GTK2RC_FILE GTK2RC_KDE4 GTK2RC_KDE4_HOME
+
diff --git a/etc/profile.d/kde-openssh-askpass.sh b/etc/profile.d/kde-openssh-askpass.sh
new file mode 100644
index 0000000..37c1531
--- /dev/null
+++ b/etc/profile.d/kde-openssh-askpass.sh
@@ -0,0 +1,2 @@
+SSH_ASKPASS=/usr/bin/ksshaskpass
+export SSH_ASKPASS 
diff --git a/etc/profile.d/kde.sh b/etc/profile.d/kde.sh
new file mode 100644
index 0000000..71c693e
--- /dev/null
+++ b/etc/profile.d/kde.sh
@@ -0,0 +1,10 @@
+
+## Make sure KDEDIRS is set
+[ -z "$KDEDIRS" ] && KDEDIRS="/usr" && export KDEDIRS
+
+## When/if using prelinking, avoids (some) use of kdeinit
+if [ -z "$KDE_IS_PRELINKED" ] ; then
+  grep -qs '^PRELINKING=yes' /etc/sysconfig/prelink && \
+  KDE_IS_PRELINKED=1 && export KDE_IS_PRELINKED
+fi
+
diff --git a/etc/xdg/plasma-workspace/env/at-spi-xwayland.sh b/etc/xdg/plasma-workspace/env/at-spi-xwayland.sh
new file mode 100644
index 0000000..7926258
--- /dev/null
+++ b/etc/xdg/plasma-workspace/env/at-spi-xwayland.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# Set the properties if and only if wayland with xwayland is present
+if [ -n "$DISPLAY" ] && [ -n "$WAYLAND_DISPLAY" ]; then
+	xprop -root -format AT_SPI_BUS 8s -set 'AT_SPI_BUS' "$( busctl call --user org.a11y.Bus /org/a11y/bus org.a11y.Bus GetAddress | sed 's/s "\(.*\)"/\1/' )"
+fi
diff --git a/etc/xdg/plasma-workspace/env/gtk2_rc_files.sh b/etc/xdg/plasma-workspace/env/gtk2_rc_files.sh
new file mode 100644
index 0000000..18d9746
--- /dev/null
+++ b/etc/xdg/plasma-workspace/env/gtk2_rc_files.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+GTK2RC_FILE=/usr/share/themes/Adwaita/gtk-2.0/gtkrc
+GTK2RC_KDE4=/usr/share/kde-settings/kde-profile/default/gtkrc-2.0-kde4
+GTK2RC_KDE4_HOME=${HOME}/.gtkrc-2.0-kde4
+
+if [ -f "${GTK2RC_FILE}" -a -f "${GTK2RC_KDE4}" -a ! -f "${GTK2RC_KDE4_HOME}" ]; then
+  install -m644 -p "${GTK2RC_KDE4}" "${GTK2RC_KDE4_HOME}"
+fi
+
+if [ -f "${GTK2RC_KDE4_HOME}" ];then
+  if [ -z "${GTK2_RC_FILES}" ]; then
+    GTK2_RC_FILES=${GTK2RC_KDE4_HOME}
+  elif ! echo ${GTK2_RC_FILES} | /bin/grep -q ${GTK2RC_KDE4_HOME} ; then
+    GTK2_RC_FILES=${GTK2_RC_FILES}:${GTK2RC_KDE4_HOME}
+  fi
+  export GTK2_RC_FILES
+fi
+
+unset GTK2RC_FILE GTK2RC_KDE4 GTK2RC_KDE4_HOME
+
diff --git a/etc/xdg/plasma-workspace/env/gtk_scrolling.sh b/etc/xdg/plasma-workspace/env/gtk_scrolling.sh
new file mode 100644
index 0000000..aec840a
--- /dev/null
+++ b/etc/xdg/plasma-workspace/env/gtk_scrolling.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# see https://bugzilla.redhat.com/show_bug.cgi?id=1226465#c20
+if [ -z "${GDK_CORE_DEVICE_EVENTS}" ]; then
+GDK_CORE_DEVICE_EVENTS=1
+export GDK_CORE_DEVICE_EVENTS
+fi
diff --git a/etc/xdg/plasma-workspace/env/ssh-agent.sh b/etc/xdg/plasma-workspace/env/ssh-agent.sh
new file mode 100644
index 0000000..4590723
--- /dev/null
+++ b/etc/xdg/plasma-workspace/env/ssh-agent.sh
@@ -0,0 +1,4 @@
+if [ "$SSH_AUTH_SOCK" = "" ]; then
+SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
+export SSH_AUTH_SOCK
+fi
\ No newline at end of file


More information about the Neon-commits mailing list