any way of saving my desktop setup to be able to re-start it later?

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
tellymandeus
Level 4
Level 4
Posts: 302
Joined: Tue Sep 10, 2013 2:31 am
Contact:

any way of saving my desktop setup to be able to re-start it later?

Post by tellymandeus »

Hi

teaching on zoom I end up with OBS, Zoom, miro.com webapp, browser, and audacity all open in a particular layout, but it takes me 5 mins to set this all up before class, is there any way to save a desktop layout of open applications so that I can open it up (with one click??) before i need to teach?

I thought of workspaces, but that would disappear every time I shut down....

thanks for any help!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Me: a non-techie Linux enthusiast running LM20.1 64-bit Cinnamon on a 2017 gamer pc I bought used...
Linux is like riding a bicycle: it's slightly more effort, but ultimately much more satisfying.
Petermint
Level 9
Level 9
Posts: 2976
Joined: Tue Feb 16, 2016 3:12 am

Re: any way of saving my desktop setup to be able to re-start it later?

Post by Petermint »

For some applications, you can create a script with startup settings. Some applications will restart at the same spot if you simple leave them setup and switch off the computer. You could also set up another user just for that work, leaving applications running in that login.

When you are not teaching, do you use those applications for anything else? If so, that means you might need a different startup profile or settings file, a way to tell the application to use something different. I have used some applications with different settings files but some have fixed default locations.

You might set up something like a VM to run a unique configuration.
User avatar
jimallyn
Level 19
Level 19
Posts: 9075
Joined: Thu Jun 05, 2014 7:34 pm
Location: Wenatchee, WA USA

Re: any way of saving my desktop setup to be able to re-start it later?

Post by jimallyn »

Hmm, this has been a popular topic lately.
“If the government were coming for your TVs and cars, then you'd be upset. But, as it is, they're only coming for your sons.” - Daniel Berrigan
Hoser Rob
Level 20
Level 20
Posts: 11762
Joined: Sat Dec 15, 2012 8:57 am

Re: any way of saving my desktop setup to be able to re-start it later?

Post by Hoser Rob »

Or maybe make a feature request to add a save state option to Cinnamon? I can't believe that a Linux DE that takes so much RAM doesn't already have this. Even Xcfe does and that looks kike something from the 90s.
For every complex problem there is an answer that is clear, simple, and wrong - H. L. Mencken
tellymandeus
Level 4
Level 4
Posts: 302
Joined: Tue Sep 10, 2013 2:31 am
Contact:

Re: any way of saving my desktop setup to be able to re-start it later?

Post by tellymandeus »

aaah interesting, so this feature doesn't actually exist, I'd need to cobble it together somehow...I'm not sure anything involving workspaces or logins is going to work on my new desktop (see my other thread about CPU 97% for the saga there...) as the lights and fans seem to keep running even when I put the system to sleep, so I may need to fully shut down every day (which is kind of annoying...)

I'd be happy to make a feature request, I can probably describe my use case in a little more detail. I'll look into the xfce version too to see how it works, I'm thinking of installing xfce mint on my laptop anyway... Where is the best place to make a feature request?
Me: a non-techie Linux enthusiast running LM20.1 64-bit Cinnamon on a 2017 gamer pc I bought used...
Linux is like riding a bicycle: it's slightly more effort, but ultimately much more satisfying.
mikeflan
Level 16
Level 16
Posts: 6912
Joined: Sun Apr 26, 2020 9:28 am
Location: Houston, TX

Re: any way of saving my desktop setup to be able to re-start it later?

Post by mikeflan »

Where is the best place to make a feature request?
Perhaps here:
https://github.com/linuxmint/cinnamon/issues
Perhaps not.
ajgringo619

Re: any way of saving my desktop setup to be able to re-start it later?

Post by ajgringo619 »

I do this with my XFCE desktop; should work fine with Cinnamon as long as you're using workspaces. FYI - this is a python script that references a .ini config file. If you need help understanding what I've done, PM me:
start_desktop.py

Code: Select all

#!/usr/bin/env python3

""" Start/move/configure my startup programs.

This program starts my preferred programs, then moves them to the 
preferred workspace. Data for the program are stored in the file
'{HOME}/bin/etc/startup_programs.ini'.
"""

from time import sleep
import configparser
import os

# setup parser for programs config file
config = configparser.ConfigParser()
config.optionxform = str
config._interpolation = configparser.ExtendedInterpolation()

HOME = os.environ['HOME']
filename = f'{HOME}/bin/etc/startup_programs.ini'

config.read(filename)


# --------------- functions --------------- #
def cmdline(command):
    from subprocess import PIPE, Popen
    import sys
    process = Popen(args=command, stdout=PIPE, shell=True)
    return process.communicate()[0].decode().strip()
    
    
def start_programs():
    # start terminal programs
    for progs in config['others']:
        os.system(config['others'][progs])

    # preferred programs
    for progs in config['programs']:
        my_prog = f'/usr/bin/dex {config["programs"][progs]}'
        os.system(my_prog)


def move_programs():
    # move programs once they're fully opened
    for window in config['workspace']:
        while not cmdline(f'wmctrl -l | grep "{window}"'):
            sleep(1)
        my_win = int(config['workspace'][window])
        cmdline(f'wmctrl -r "{window}" -t {my_win}')


def set_window_state():
    # configure program window state
    for window in config['window_state']:
        win_state = config['window_state'][window]
        if win_state == 'normal':
            continue
        cmdline(f'wmctrl -r "{window}" -b {win_state}')


def set_window_size():
    # configure program window size
    for window in config['window_size']:
        win_size = config['window_size'][window]
        cmdline(f'wmctrl -r "{window}" -e {win_size}')
# --------------- end functions --------------- #


# ---------- Main Program ---------- #
if __name__ == '__main__':
    start_programs()
    move_programs()
    set_window_state()
    set_window_size()
startup_programs.ini

Code: Select all

[common]
; This section defines my common variables
home:           /home/username
flatpak_dir:    ${home}/.local/share/flatpak/exports/share/applications
system_dir:     /usr/share/applications
user_dir:       ${home}/.local/share/applications

[programs]
; This section contains my programs that are started by using '/usr/bin/dex'
brave:          ${common:system_dir}/brave-browser.desktop
protonmail:     ${common:user_dir}/webapp-ProtonMail1765.desktop
protoncalendar: ${common:user_dir}/webapp-ProtonMailCalendar6989.desktop
gnucash:        ${common:user_dir}/gnucash.desktop
libreoffice:    ${common:user_dir}/libreoffice7.1-startcenter.desktop
spotify:        ${common:user_dir}/com.spotify.Client.desktop

[others]
; For other programs, such as terminals
console:        xfce4-terminal --default-working-directory=${common:home}/bin \
                --maximize --hide-menubar --hide-borders --hide-toolbar --tab --tab \
                --tab -T "IPython Console (v3.8)" -e "${common:home}/.local/bin/ipython" \
                --tab -T "OneDrive Status" -e "journalctl --user -fu onedrive" \
                --tab -T "System Logs" -e "journalctl -fxb --no-hostname --no-full"
console2:       xfce4-terminal --maximize --hide-menubar --hide-borders \ 
                --hide-toolbar -T "System Monitor" -e "${common:home}/.local/bin/bpytop"

[workspace]
; These sections will replace the [windows] section. This structure will 
; give me more flexibility on window manipulation:
;       window size, window state, and window location
Brave:                          0
ProtonMail:                     1
ProtonCalendar:                 1
System Logs:                    2
System Monitor:                 2
username.gnucash:               4
LibreOffice:                    4
Spotify:                        5

[window_state]
Brave:                          normal
ProtonMail:                     normal
ProtonCalendar:                 normal
System Logs:                    normal
System Monitor:                 add,maximized_vert,maximized_horz
username.gnucash:               normal
LibreOffice:                    normal
Spotify:                        add,maximized_vert,maximized_horz

[window_size]
Brave:                          0,25,10,1380,1000
Evolution:                      0,-1,-1,-1,-1
ProtonMail:                     0,-1,-1,-1,-1
ProtonCalendar:                 0,1920,-1,-1,-1
System Logs:                    0,0,-1,-1,-1
System Monitor:                 0,1920,-1,-1,-1
username.gnucash:               0,1920,-1,-1,-1
LibreOffice:                    0,-1,-1,-1,-1
Spotify:                        0,1920,-1,-1,-1
The basic functionality of this script is to first load all the programs, then move/resize them after they completely load.
tellymandeus
Level 4
Level 4
Posts: 302
Joined: Tue Sep 10, 2013 2:31 am
Contact:

Re: any way of saving my desktop setup to be able to re-start it later?

Post by tellymandeus »

thanks, do I understand correctly that I'd need to edit this to work for my setup? Or is there some "save this configuration" feature I am missing? If you could give me a little guidance on how to get this working on my machine I'd be grateful

(can PM if you prefer)
Me: a non-techie Linux enthusiast running LM20.1 64-bit Cinnamon on a 2017 gamer pc I bought used...
Linux is like riding a bicycle: it's slightly more effort, but ultimately much more satisfying.
User avatar
rossdv8
Level 7
Level 7
Posts: 1737
Joined: Wed Apr 23, 2014 4:48 am
Location: Within 2,000 kilometres of Alice Springs, Australia
Contact:

Re: any way of saving my desktop setup to be able to re-start it later?

Post by rossdv8 »

I deleted this - it actually doesn;t seem to work on Cinnamon. Sorry. :)
Last edited by rossdv8 on Mon Jun 21, 2021 7:18 pm, edited 2 times in total.
Current main OS: MInt 21.3 with KDE Plasma 5.27 (using Compiz as WM) - Kernel: 6.5.0-15 on Lenovo m900 Tiny, i5-6400T (intel HD 530 graphics) 16GB RAM.
Sharks usually only attack you if you are wet
ajgringo619

Re: any way of saving my desktop setup to be able to re-start it later?

Post by ajgringo619 »

tellymandeus wrote: Mon Jun 21, 2021 3:08 am thanks, do I understand correctly that I'd need to edit this to work for my setup? Or is there some "save this configuration" feature I am missing? If you could give me a little guidance on how to get this working on my machine I'd be grateful

(can PM if you prefer)
You absolutely need to edit the .ini file. Please PM me so we can discuss this further.
Locked

Return to “Software & Applications”