Xfce Forum

Sub domains
 

You are not logged in.

#1 2018-09-06 15:51:44

johnywhy
Member
Registered: 2011-10-09
Posts: 151

Disable xfce4-session?

xfce4-session process consumes a lot of RAM on my low-RAM machine.

I never, ever save sessions. I want to disable this process.

But when i kill the process, xfce goes down. And when i try to uninstall xfce4-session in Synaptic, it tells me it's going to uninstall xfce completely. I don't want that.

How can i disable this process, and keep xfce running?

THX


Mint 19 xfce, 4.15.0-29-generic #31-Ubuntu SMP, x86_64 x86_64 x86_64 GNU/Linux

Offline

#2 2018-09-06 21:16:35

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 4,761

Re: Disable xfce4-session?

johnywhy wrote:

xfce4-session process consumes a lot of RAM on my low-RAM machine.

How much RAM does it consume?

I never, ever save sessions. I want to disable this process.

Session managers do more than just save sessions, namely handling the logout/restart process as well. (Though you can still use the manual methods).

But when i kill the process, xfce goes down. And when i try to uninstall xfce4-session in Synaptic, it tells me it's going to uninstall xfce completely. I don't want that.

Perhaps its telling you that its just going to uninstall the Xfce meta package - which won't really install all of Xfce, just the Meta package. Can you post the message that you are getting?

How can i disable this process, and keep xfce running?

There is a way. To try it, rename /usr/bin/xfce4-session (to /usr/bin/xfce4-session.BAK). There is also a bug (I'll need to report this), but manually edit the /etc/xdg/xfce4/xinitrc file and change the line that reads:

xfwm4 --daemon

...to read:

xfwm4 &

Then restart your computer. This works for me on Arch, but I don't have a Mint system handy to see if it works there.

To reset everything, simply rename xfce4-session.BAK back to its original name.

Offline

#3 2018-09-06 22:41:14

johnywhy
Member
Registered: 2011-10-09
Posts: 151

Re: Disable xfce4-session?

consumes 10 to 20 MB. Don't laugh, i'm trying to trim every bit, for 1GB-2GB machines.

no error-- Synaptic simply reports that it's going to uninstall xfce, when i mark xfce4-session for uninstallation.

is xfce4-session needed for command-line login?

THX


Mint 19 xfce, 4.15.0-29-generic #31-Ubuntu SMP, x86_64 x86_64 x86_64 GNU/Linux

Offline

#4 2018-09-06 22:53:00

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 4,761

Re: Disable xfce4-session?

Xfce is very modular. Although xfce4-session provides a lot of important functionality, it is not required. However, for Xfce to still start properly you need the /etc/xdg/xfce4/xinitrc file that is contained within that package. If you plan to uninstall xfce4-session, copy that file to the ~/.config/xfce4 folder (plus make the change to the xfwm4 command) so that the environment will still start properly.

no error-- Synaptic simply reports that it's going to uninstall xfce, when i mark xfce4-session for uninstallation.

Confirm that its the Xfce meta package that is going to be uninstalled - as opposed to the individual Xfce components.

Offline

#5 2018-09-06 23:15:45

johnywhy
Member
Registered: 2011-10-09
Posts: 151

Re: Disable xfce4-session?

i'm doing this on a custom DebianDog Stretch, not Mint.
http://murga-linux.com/puppy/viewtopic.php?t=111199

Mint is debian-based, so hoping this doesn't hose my OS  hmm

ToZ wrote:

for Xfce to still start properly you need the /etc/xdg/xfce4/xinitrc file that is contained within that package. If you plan to uninstall xfce4-session, copy that file to the ~/.config/xfce4 folder (plus make the change to the xfwm4 command) so that the environment will still start properly.

phenomenal!

Confirm that its the Xfce meta package that is going to be uninstalled - as opposed to the individual Xfce components.

Oj9tptQl.png

Update: Wow, it worked! I booted into xfce, no probs. Session is not running.

So far, (with several other tweaks), i got my boot idle down to 85 MB. Not done, tho' big_smile

new problem
orage now opens on boot, and it keeps running if i close it. How to prevent that?


THX

Last edited by johnywhy (2018-09-06 23:48:23)


Mint 19 xfce, 4.15.0-29-generic #31-Ubuntu SMP, x86_64 x86_64 x86_64 GNU/Linux

Offline

#6 2018-09-07 00:10:51

MountainDewManiac
Member
From: Where Mr. Bankruptcy is Prez
Registered: 2013-03-24
Posts: 1,007

Re: Disable xfce4-session?

johnywhy wrote:

Mint is debian-based

Mint does have one version of its distro that is built on Debian, LMDE3 (Linux Mint Debian Edition 3). But all of the main editions of Mint are built on Ubuntu.

Regards,
MDM


Mountain Dew Maniac

How to Ask for Help <=== Click on this link

Offline

#7 2018-09-07 00:14:15

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 4,761

Re: Disable xfce4-session?

johnywhy wrote:

new problem
orage now opens on boot, and it keeps running if i close it. How to prevent that?

Edit the xinitrc file and comment out or remove the line that starts orage. Not sure why its there.

Offline

#8 2018-09-07 04:48:25

johnywhy
Member
Registered: 2011-10-09
Posts: 151

Re: Disable xfce4-session?

ToZ wrote:
johnywhy wrote:

orage now opens on boot

Edit the xinitrc file and comment out or remove the line that starts orage.

Worked!

New issue, nothing in  ~/Startup/ gets executed now. Suggestions?

THX

Last edited by johnywhy (2018-09-07 04:48:48)


Mint 19 xfce, 4.15.0-29-generic #31-Ubuntu SMP, x86_64 x86_64 x86_64 GNU/Linux

Offline

#9 2018-09-07 10:30:09

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 4,761

Re: Disable xfce4-session?

That is one of the jobs of xfce4-session.

As a workaround, try creating ~/.xprofile and adding the applications to autostart there (make the file executable) or add them to the end of the xinitrc file.

Offline

#10 2018-09-07 11:54:25

johnywhy
Member
Registered: 2011-10-09
Posts: 151

Re: Disable xfce4-session?

Thx for thinking outside the box, ToZ!

But Startup is a directory, into which i can put script files. So i don't want to call the scripts in .xprofile. Rather, i want a command that says "Execute everything in the Startup directory".

i put this into my .xprofile. Is this a good idea? Good syntax?

#!/bin/bash
run-parts --new-session ~/Startup

The scripts aren't executing on boot. This works at CLI:
sh ~/.xprofile

So, .xprofile isn't getting called on boot.

Any ideas?

THX

Last edited by johnywhy (2018-09-07 12:29:07)


Mint 19 xfce, 4.15.0-29-generic #31-Ubuntu SMP, x86_64 x86_64 x86_64 GNU/Linux

Offline

#11 2018-09-07 12:44:29

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 4,761

Re: Disable xfce4-session?

You might want to try something like:

for s in ~/Startup/*
do
   test -x "$s" && (nohup "$s" > /dev/null 2>&1 &)
done

Add this to the end of the xinitrc file.

Offline

#12 2018-09-07 21:05:45

johnywhy
Member
Registered: 2011-10-09
Posts: 151

Re: Disable xfce4-session?

your script works if i execute it directly.
but not getting executed on boot.

also, nothing in Session and Startup app is starting.

more info that might be relevant: this OS is running init, not systemd

# ls -l $(which init)
-rwxr-xr-x 1 root root 43532 Feb 12  2017 /sbin/init

but systemd is available

# pstree -p
init(1)─┬─Thunar(2474)─┬─{gdbus}(2476)
        │              └─{gmain}(2475)
        ├─cgmanager(2073)
        ├─dbus-daemon(2258)
        ├─dbus-daemon(2079)
        ├─dbus-launch(2257)
....
        ├─systemd-logind(2186)
        ├─systemd-udevd(1123)

as i'm still learning--

THX

Last edited by johnywhy (2018-09-07 23:11:11)


Mint 19 xfce, 4.15.0-29-generic #31-Ubuntu SMP, x86_64 x86_64 x86_64 GNU/Linux

Offline

#13 2018-09-07 23:09:59

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 4,761

Re: Disable xfce4-session?

johnywhy wrote:

your script works if i execute it directly.
but not getting executed on boot.

It doesn't get executed at boot but rather on login.
- How are you logging in? Console login or display manager?
- Where did you put the script?
- Can you post back the full contents of your ~/.config/xfce4/xinitrc file?

also, nothing in Session and Startup app is starting.

This is because you disabled xfce4-session. Starting those apps is the job of xfce4-session.

Offline

#14 2018-09-10 18:25:05

johnywhy
Member
Registered: 2011-10-09
Posts: 151

Re: Disable xfce4-session?

ToZ wrote:

How are you logging in? Console login or display manager?

the distro i'm using seems to have disabled level 3 boot, and there's no slim or other login manager. It boots right into a root desktop (those crazy puppy linux people). This is not desirable for my scenario, so i don't want to spend time trying to make your script work in this environment. I'll install a 'normal' linux soon, to continue this experiment.

Where did you put the script?

/root/.xinitrc

Can you post back the full contents of your ~/.config/xfce4/xinitrc file?

#!/bin/sh

# fix broken $UID on some system...
if test "x$UID" = "x"; then
  if test -x /usr/xpg4/bin/id; then
    UID=`/usr/xpg4/bin/id -u`;
  else
    UID=`id -u`;
  fi
fi

# set $XDG_MENU_PREFIX to "xfce-" so that "xfce-applications.menu" is picked
# over "applications.menu" in all Xfce applications.
if test "x$XDG_MENU_PREFIX" = "x"; then
  XDG_MENU_PREFIX="xfce-"
  export XDG_MENU_PREFIX
fi

# set DESKTOP_SESSION so that one can detect easily if an Xfce session is running
if test "x$DESKTOP_SESSION" = "x"; then
  DESKTOP_SESSION="xfce"
  export DESKTOP_SESSION
fi

# set XDG_CURRENT_DESKTOP so that Qt 5 applications can identify user set Xfce theme
if test "x$XDG_CURRENT_DESKTOP" = "x"; then
  XDG_CURRENT_DESKTOP="XFCE"
  export XDG_CURRENT_DESKTOP
fi

# $XDG_CONFIG_HOME defines the base directory relative to which user specific
# configuration files should be stored. If $XDG_CONFIG_HOME is either not set
# or empty, a default equal to $HOME/.config should be used.
if test "x$XDG_CONFIG_HOME" = "x" ; then
  XDG_CONFIG_HOME=$HOME/.config
fi
[ -d "$XDG_CONFIG_HOME" ] || mkdir "$XDG_CONFIG_HOME"

# $XDG_CACHE_HOME defines the base directory relative to which user specific
# non-essential data files should be stored. If $XDG_CACHE_HOME is either not
# set or empty, a default equal to $HOME/.cache should be used.
if test "x$XDG_CACHE_HOME" = "x" ; then
  XDG_CACHE_HOME=$HOME/.cache
fi
[ -d "$XDG_CACHE_HOME" ] || mkdir "$XDG_CACHE_HOME"

# set up XDG user directores.  see
# http://freedesktop.org/wiki/Software/xdg-user-dirs
if which xdg-user-dirs-update >/dev/null 2>&1; then
    xdg-user-dirs-update
fi

# Modify libglade and glade environment variables so that
# it will find the files installed by Xfce
GLADE_CATALOG_PATH="$GLADE_CATALOG_PATH:"
GLADE_PIXMAP_PATH="$GLADE_PIXMAP_PATH:"
GLADE_MODULE_PATH="$GLADE_MODULE_PATH:"
export GLADE_CATALOG_PATH
export GLADE_PIXMAP_PATH
export GLADE_MODULE_PATH

# For now, start with an empty list
XRESOURCES=""

# Has to go prior to merging Xft.xrdb, as its the "Defaults" file
test -r "/etc/xdg/xfce4/Xft.xrdb" && XRESOURCES="$XRESOURCES /etc/xdg/xfce4/Xft.xrdb"
test -r $HOME/.Xdefaults && XRESOURCES="$XRESOURCES $HOME/.Xdefaults"

BASEDIR=$XDG_CONFIG_HOME/xfce4
if test -r "$BASEDIR/Xft.xrdb"; then
  XRESOURCES="$XRESOURCES $BASEDIR/Xft.xrdb"
elif test -r "$XFCE4HOME/Xft.xrdb"; then
  mkdir -p "$BASEDIR"
  cp "$XFCE4HOME/Xft.xrdb" "$BASEDIR"/
  XRESOURCES="$XRESOURCES $BASEDIR/Xft.xrdb"
fi

# merge in X cursor settings
test -r "$BASEDIR/Xcursor.xrdb" && XRESOURCES="$XRESOURCES $BASEDIR/Xcursor.xrdb"

# ~/.Xresources contains overrides to the above
test -r "$HOME/.Xresources" && XRESOURCES="$XRESOURCES $HOME/.Xresources"

# load all X resources (adds /dev/null to avoid an empty list that would hang the process)
cat /dev/null $XRESOURCES | xrdb -merge -

# load local modmap
test -r $HOME/.Xmodmap && xmodmap $HOME/.Xmodmap

# run xfce4-session if installed
if which xfce4-session >/dev/null 2>&1; then

  # check if we start xfce4-session with ck-launch-session. this is only
  # required for starting from a console, not a login manager
  if test "x$XFCE4_SESSION_WITH_CK" = "x1"; then
    if which ck-launch-session >/dev/null 2>&1; then
      ck-launch-session xfce4-session
    else
      echo
      echo "You have tried to start Xfce with consolekit support, but"
      echo "ck-launch-session is not installed."
      echo "Aborted startup..."
      echo

      exit 1
    fi
  else
    # start xfce4-session normally
    xfce4-session
  fi

  exit 0
fi

##################
# IMPORTANT NOTE #
##################

# Everything below here ONLY gets executed if you are NOT using xfce4-session
# (Xfce's session manager).  If you are using the session manager, everything
# below is handled by it, and the code below is not executed at all.  If you're
# not sure if you're using the session manager, type 'ps -e|grep xfce4-session'
# in a terminal while Xfce is running.

##################

# Use dbus-launch if installed.
if test x"$DBUS_SESSION_BUS_ADDRESS" = x""; then
  if which dbus-launch >/dev/null 2>&1; then
    eval `dbus-launch --sh-syntax --exit-with-session`
    # some older versions of dbus don't export the var properly
    export DBUS_SESSION_BUS_ADDRESS
  else
    echo "Could not find dbus-launch; Xfce will not work properly" >&2
    fi
fi

# this is only necessary when running w/o xfce4-session
xsetroot -solid black -cursor_name watch

# or use old-fashioned startup script otherwise

xfsettingsd &
xfwm4 &

# start up stuff in $XDG_CONFIG_HOME/autostart/
if test -d "$XDG_CONFIG_HOME/autostart"; then
  for i in ${XDG_CONFIG_HOME}/autostart/*.desktop; do
    grep -q -E "^Hidden=true" "$i" && continue
    if grep -q -E "^OnlyShowIn=" "$i"; then
      # need to test twice, as lack of the line entirely means we still run it
      grep -E "^OnlyShowIn=" "$i" | grep -q 'XFCE;' || continue
    fi
    grep -E "^NotShowIn=" "$i" | grep -q 'XFCE;' && continue

    # check for TryExec
    trycmd=`grep -E "^TryExec=" "$i" | cut -d'=' -f2`
    if test "$trycmd"; then
      which "$trycmd" >/dev/null 2>&1 || continue
    fi

    cmd=`grep -E "^Exec=" "$i" | cut -d'=' -f2`
    if test "$cmd" && which "$cmd" >/dev/null 2>&1; then
      $cmd &
    fi
  done
fi

xfdesktop&
orage &

panel=`which xfce4-panel`
case "x$panel" in
	x|xno*)
		;;
	*)
		$panel
		ret=$?
		while test $ret -ne 0; do
			xmessage -center -file - -timeout 20 -title Error <<EOF
A crash occured in the panel
Please report this to the xfce4-dev@xfce.org list
or on http://bugs.xfce.org
Meanwhile the panel will be restarted
EOF
			cat >&2 <<EOF
A crash occured in the panel
Please report this to the xfce4-dev@xfce.org list
or on http://bugs.xfce.org
Meanwhile the panel will be restarted
EOF
			$panel
			ret=$?
		done
		;;
esac

xsetroot -bg white -fg red  -solid black -cursor_name watch

also, nothing in Session and Startup app is starting.

This is because you disabled xfce4-session. Starting those apps is the job of xfce4-session.

ok, if possible i'd like to find a way to make that work too.

THX!


Mint 19 xfce, 4.15.0-29-generic #31-Ubuntu SMP, x86_64 x86_64 x86_64 GNU/Linux

Offline

#15 2018-09-11 00:44:52

MountainDewManiac
Member
From: Where Mr. Bankruptcy is Prez
Registered: 2013-03-24
Posts: 1,007

Re: Disable xfce4-session?

johnywhy wrote:
ToZ wrote:

How are you logging in? Console login or display manager?

the distro i'm using seems to have disabled level 3 boot, and there's no slim or other login manager. It boots right into a root desktop (those crazy puppy linux people).

That should be simple to fix. Here's a thread with directions on doing so:
http://www.murga-linux.com/puppy/viewtopic.php?t=21338
...but it is quite old. As the distro's boot procedure might have changed, you should probably create a new thread on that distro's community support forum asking how to do it. Or spend more than the three seconds that I did on glancing at the search results for "puppy linux login manager," lol.

Regards,
MDM


Mountain Dew Maniac

How to Ask for Help <=== Click on this link

Offline

Board footer

Powered by FluxBB