Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #261610 > unrolled thread

automate resumption of session

Started by"Russell L. Harris" <russell@rlharris.org>
First post2023-09-13 02:20 +0200
Last post2023-09-13 11:10 +0200
Articles 11 — 6 participants

Back to article view | Back to linux.debian.user


Contents

  automate resumption of session "Russell L. Harris" <russell@rlharris.org> - 2023-09-13 02:20 +0200
    Re: automate resumption of session Larry Martell <larry.martell@gmail.com> - 2023-09-13 02:30 +0200
      Re: automate resumption of session "Russell L. Harris" <russell@rlharris.org> - 2023-09-13 02:40 +0200
        Re: automate resumption of session Stefan Monnier <monnier@iro.umontreal.ca> - 2023-09-13 04:50 +0200
          Re: automate resumption of session "Russell L. Harris" <russell@rlharris.org> - 2023-09-13 05:20 +0200
            Re: automate resumption of session Charles Curley <charlescurley@charlescurley.com> - 2023-09-13 06:20 +0200
    Re: automate resumption of session Charles Curley <charlescurley@charlescurley.com> - 2023-09-13 03:20 +0200
      Re: automate resumption of session "Russell L. Harris" <russell@rlharris.org> - 2023-09-13 03:30 +0200
    Re: automate resumption of session Manphiz <manphiz@gmail.com> - 2023-09-13 04:30 +0200
      Re: automate resumption of session Stefan Monnier <monnier@iro.umontreal.ca> - 2023-09-14 18:00 +0200
    Re: automate resumption of session Dieter Rohlfing <dr-erc@gmx.net> - 2023-09-13 11:10 +0200

#261610 — automate resumption of session

From"Russell L. Harris" <russell@rlharris.org>
Date2023-09-13 02:20 +0200
Subjectautomate resumption of session
Message-ID<HdlLP-8AKt-3@gated-at.bofh.it>
I am a writer.  I use Emacs and LaTeX markup on a Debian/XFCE system.
On a typical day, I have in progress three or four articles.  I may
work for several days on a given article.

Each article is in a separate XFCE workspace.  The text for each
article resides in its own directory.  For each article, I keep open
an instance of emacs, a terminal window from which I execute latex and
xdvi, and the xdvi window.

When I leave the office for the day, I typically shut down the
computer.  The next morning, the first order of business is to
recreate the previous working environment or ``session.''  For each
article, this entails:

(1) Click on the appropriate workspace button.

(2) Open an instance of emacs.

(3) In the emacs window, use the mouse to click on the icon to resize
the window.

(4) In emacs, open the file in the document directory.

(5) Open a terminal window.

(6) In the terminal window, use the mouse to click on the icon to
resize the window.

(7) In the terminal, cd to the document directory.

(8) In the terminal, execute ``xdiv ... &'' to display the document.

I would like write a script to automate the process, so that I need
only boot the computer and type RESUME; but my efforts have been
unsuccessful.

RLH

[toc] | [next] | [standalone]


#261612

FromLarry Martell <larry.martell@gmail.com>
Date2023-09-13 02:30 +0200
Message-ID<HdlVv-8ANv-3@gated-at.bofh.it>
In reply to#261610

[Multipart message — attachments visible in raw view] — view raw

On Tue, Sep 12, 2023 at 8:15 PM Russell L. Harris <russell@rlharris.org>
wrote

> When I leave the office for the day, I typically shut down the
> computer.
>
Why? I never turn my computer off.

[toc] | [prev] | [next] | [standalone]


#261614

From"Russell L. Harris" <russell@rlharris.org>
Date2023-09-13 02:40 +0200
Message-ID<Hdm5b-8AQy-1@gated-at.bofh.it>
In reply to#261612
On Tue, Sep 12, 2023 at 08:19:54PM -0400, Larry Martell wrote:
>On Tue, Sep 12, 2023 at 8:15 PM Russell L. Harris <russell@rlharris.org> wrote
>
>    When I leave the office for the day, I typically shut down the
>    computer.  
>
>Why? I never turn my computer off. 

I wish I had that option.  But I live way out in the country, and now
and then there is a power outage.  My computer is running on a UPS,
but UPS batteries die after being run down more than a few times, and
battery replacement is expensive.  And then there are lightning
storms...

RLH

[toc] | [prev] | [next] | [standalone]


#261618

FromStefan Monnier <monnier@iro.umontreal.ca>
Date2023-09-13 04:50 +0200
Message-ID<Hdo6Z-8C5y-3@gated-at.bofh.it>
In reply to#261614
>>    When I leave the office for the day, I typically shut down the
>>    computer.  Why? I never turn my computer off.

Same here, I always just suspend.

> I wish I had that option.  But I live way out in the country, and now
> and then there is a power outage.  My computer is running on a UPS,
> but UPS batteries die after being run down more than a few times, and
> battery replacement is expensive.  And then there are lightning
> storms...

For those computers where I'm not coming back to them the next day,
I hibernate them, so they're truly "off" and a powercut is perfectly
harmless, but when I turn them back on I get back to where I was.


        Stefan

[toc] | [prev] | [next] | [standalone]


#261619

From"Russell L. Harris" <russell@rlharris.org>
Date2023-09-13 05:20 +0200
Message-ID<HdoA1-8Cuv-1@gated-at.bofh.it>
In reply to#261618
On Tue, Sep 12, 2023 at 10:40:43PM -0400, Stefan Monnier wrote:
>>>    When I leave the office for the day, I typically shut down the
>>>    computer.  Why? I never turn my computer off.
>
>Same here, I always just suspend.
>
>> I wish I had that option.  But I live way out in the country, and now
>> and then there is a power outage.  My computer is running on a UPS,
>> but UPS batteries die after being run down more than a few times, and
>> battery replacement is expensive.  And then there are lightning
>> storms...
>
>For those computers where I'm not coming back to them the next day,
>I hibernate them, so they're truly "off" and a powercut is perfectly
>harmless, but when I turn them back on I get back to where I was.

I have been using Debian since A.D.2000, but I never have been clear
on the use of suspend and hibernate.  If I am going to power-down the
computer, hibernate sounds good; but how do I resume?

RLH

[toc] | [prev] | [next] | [standalone]


#261620

FromCharles Curley <charlescurley@charlescurley.com>
Date2023-09-13 06:20 +0200
Message-ID<Hdpw5-8D2k-1@gated-at.bofh.it>
In reply to#261619
On Wed, 13 Sep 2023 03:16:28 +0000
"Russell L. Harris" <russell@rlharris.org> wrote:

> I have been using Debian since A.D.2000, but I never have been clear
> on the use of suspend and hibernate.  If I am going to power-down the
> computer, hibernate sounds good; but how do I resume?

Reboot as you always do. Hibernate uses swap space to preserve portions
of RAM. As the system boots, it will examine the swap space and read
the data back into RAM.

You may wish to reboot from time to time. I observe some of my laptops
get crankier the more I hibernate them.


-- 
Does anybody read signatures any more?

https://charlescurley.com
https://charlescurley.com/blog/

[toc] | [prev] | [next] | [standalone]


#261615

FromCharles Curley <charlescurley@charlescurley.com>
Date2023-09-13 03:20 +0200
Message-ID<HdmHT-8Bim-1@gated-at.bofh.it>
In reply to#261610
On Wed, 13 Sep 2023 00:14:53 +0000
"Russell L. Harris" <russell@rlharris.org> wrote:

> For each article, I keep open
> an instance of emacs, a terminal window from which I execute latex and
> xdvi, and the xdvi window.

Don't do that. Open one instance of emacs, then use multiple frames,
one (or more) on each workspace. C-x 5 2. C-x 5 0 to close one. Even
today emacs is a resource hog. You can then open all the files you
want, in multiple frames or multiple windows within each frame. Also, I
suspect that the next step won't work with multiple instances of emacs,
without some serious and quite unnecessary finagling.

Now, to preserve all that across sessions, use emacs' desktop mode.
https://www.gnu.org/software/emacs/manual/html_node/emacs/Saving-Emacs-Sessions.html,
https://www.emacswiki.org/emacs?action=browse;oldid=DeskTop;id=Desktop
You may have to manually save emacs' desktop once, but after that emacs
will save the desktop for you on exit, and restore it on launch.

Those two changes should get rid of a lot of your morning routine.

For the rest, look at XFCE's ability to save sessions. Applications ->
Settings -> Sessions and Startup. For example, preserving XFCE
terminals includes preserving the working directory.

Also recall that Bash (and most other shells) reserve a history of
previously used commands. Instead of typing, e.g.,

vlc ~/Music/playlist.m3u &

I find it much simpler to type

^Rvlc

or some such.
-- 
Does anybody read signatures any more?

https://charlescurley.com
https://charlescurley.com/blog/

[toc] | [prev] | [next] | [standalone]


#261616

From"Russell L. Harris" <russell@rlharris.org>
Date2023-09-13 03:30 +0200
Message-ID<HdmRz-8Bls-1@gated-at.bofh.it>
In reply to#261615
On Tue, Sep 12, 2023 at 07:10:34PM -0600, Charles Curley wrote:
>Don't do that. ...

Noted and now being implemented.  Many thanks, Charles.

RLH

[toc] | [prev] | [next] | [standalone]


#261617

FromManphiz <manphiz@gmail.com>
Date2023-09-13 04:30 +0200
Message-ID<HdnND-8BYV-1@gated-at.bofh.it>
In reply to#261610
"Russell L. Harris" <russell@rlharris.org> writes:

> I am a writer.  I use Emacs and LaTeX markup on a Debian/XFCE system.
> On a typical day, I have in progress three or four articles.  I may
> work for several days on a given article.
>
> Each article is in a separate XFCE workspace.  The text for each
> article resides in its own directory.  For each article, I keep open
> an instance of emacs, a terminal window from which I execute latex and
> xdvi, and the xdvi window.
>
> When I leave the office for the day, I typically shut down the
> computer.  The next morning, the first order of business is to
> recreate the previous working environment or ``session.''  For each
> article, this entails:
>
> (1) Click on the appropriate workspace button.
>
> (2) Open an instance of emacs.
>
> (3) In the emacs window, use the mouse to click on the icon to resize
> the window.
>
> (4) In emacs, open the file in the document directory.
>
> (5) Open a terminal window.
>
> (6) In the terminal window, use the mouse to click on the icon to
> resize the window.
>
> (7) In the terminal, cd to the document directory.
>
> (8) In the terminal, execute ``xdiv ... &'' to display the document.
>
> I would like write a script to automate the process, so that I need
> only boot the computer and type RESUME; but my efforts have been
> unsuccessful.
>
> RLH
>

If hibernation can work reliably on your system it would seem to meet
your requirement.

-- 
Manphiz

[toc] | [prev] | [next] | [standalone]


#261670

FromStefan Monnier <monnier@iro.umontreal.ca>
Date2023-09-14 18:00 +0200
Message-ID<HdWV3-8XzL-9@gated-at.bofh.it>
In reply to#261617
> If hibernation can work reliably on your system it would seem to meet
> your requirement.

FWIW, hibernation should usually work "on any system".

Usually if it doesn't work it's because the system's boot setup doesn't
accommodate it rather than because the hardware (or Linux) doesn't
support it.

The more common way to make it work relies on using a swap partition,
and an initramfs boot step that is able to find that swap partition, for
example.


        Stefan

[toc] | [prev] | [next] | [standalone]


#261623

FromDieter Rohlfing <dr-erc@gmx.net>
Date2023-09-13 11:10 +0200
Message-ID<Hdu2J-8Ghs-5@gated-at.bofh.it>
In reply to#261610
Am Wed, 13 Sep 2023 00:14:53 +0000
schrieb "Russell L. Harris" <russell@rlharris.org>:

>When I leave the office for the day, I typically shut down the
>computer.  The next morning, the first order of business is to
>recreate the previous working environment or ``session.''  For each
>article, this entails:

Don't close/exit your running applications on the XFCE desktop, leave
them open/running and choose "Shutdown" from the XFCE exit dialogue.

On next login in to the XFCE desktop, XFCE will start all applications,
which have been open at reboot/shutdown time. Works for me with Debian
Bullseye/XFCE. Just try and test it with Bookworm/XFCE.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web