You are not logged in.

#1 2017-02-03 14:43

Werner Holtfreter
Member
Registered: 2016-10-09
Posts: 46

Transfer Desktop Settings to new User

Hallo,

I spent a lot of time for desktop settings. How can I transfer this settings to a new user on the same system?

The consistence of the lot of configuration files seems to be important. My experience: For restore after data lost I mixed the weekly full backup with the daily part backup with some configuration files and had an instable system. The reason for daily backup of some configuration files is, for example, ~/.trinity/share/apps/kmail/mail

Werner

Offline

#2 2017-02-03 18:29

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Transfer Desktop Settings to new User

You could try my theme backup utility, this will backup your desktop settings to a tar.gz file (/home/user/.config/daithemebackup/themebackup_001.tar.gz by default) You can add any extra files you would like to backup in the config file (/home/user/.config/daithemebackup/config.file) and it will include them (if they exist).

It is not a perfect backup solution as I only created it primarily to backup my own desktop settings and then adapted to share with others.

It can be found in this post if you want to try it.

Offline

#3 2017-02-04 07:01

bin
Member
From: U.K.
Registered: 2016-01-28
Posts: 1,300

Re: Transfer Desktop Settings to new User

I can vouch for the value of this bit of software - it's a real time saver.

I would mention that the config files - and indeed the backup - do contain the user name in path values. So, if you wanted to apply these to a new user you would have to find and replace the old name with the new one. I imagine it would not be too hard to alter the process to replace the user name with a variable in the backup and then query the new variable in the restore process..........  smile

Offline

#4 2017-02-04 10:25

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Transfer Desktop Settings to new User

yes, I hadn't thought about the user name... I will look into this and maybe add an option to import another users backup. If I come up with something usable I will post an update. smile

Offline

#5 2017-02-05 02:37

Werner Holtfreter
Member
Registered: 2016-10-09
Posts: 46

Re: Transfer Desktop Settings to new User

Dai_trying, thank you very much for your great work!

My first run was successful. To be honest, I hope, it will work without side effects which can come from inconsistent config files. To give a second example: I installed a meta package with all Trinity programs and the result was the need of new install...

I noticed only one little gap: The number of desktops and the configuration of kpager-trinity (the desktop switcher) would not transfered to the other user.

And I would prefer a "Sure?" request for "Reset to Q4OS default".

Perhaps, I am wrong, but I do not remember password request for installation the program. Can this be?

Dai_trying, you have searched the relevant files for desktop configuration. Do you think, they are well ordered? For me it is chaos. For example, it is crazy to put the kmail maildir deep in a hided directory. I want to see it and backup it and I could see it in my first Linux Distribution Suse a lot of years ago. One path for configuration of all programs, splitted in one sub path for each program and one path for configuration of desktop environment - and your work would be superfluous. But I am not a programmer, could be, it is more complicated and we need a registry ;-)

Last edited by Werner Holtfreter (2017-02-05 02:43)

Offline

#6 2017-02-05 12:20

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Transfer Desktop Settings to new User

Werner Holtfreter wrote:

Dai_trying, thank you very much for your great work!

You are welcome smile

Werner Holtfreter wrote:

My first run was successful. To be honest, I hope, it will work without side effects which can come from inconsistent config files. To give a second example: I installed a meta package with all Trinity programs and the result was the need of new install...

I'm not sure this is connected to Desktop settings, but if you could post more information maybe we could find out why you needed to reinstall. i.e. package installed, exact command used (or gui used), reason for reinstall (what did / did not work)

Werner Holtfreter wrote:

I noticed only one little gap: The number of desktops and the configuration of kpager-trinity (the desktop switcher) would not transfered to the other user.

I will look into this and see if there is a config file I can add to make this work.

Werner Holtfreter wrote:

And I would prefer a "Sure?" request for "Reset to Q4OS default".

Yes, this is an oversight on my part, I will add it to the next release.

Werner Holtfreter wrote:

Perhaps, I am wrong, but I do not remember password request for installation the program. Can this be?

This is entirely down to how you have permissions set on your system, if you have entered your sudo password recently then you will still have elevated privileges and not be asked again for your password. This can be adjusted by following the instructions in this post.

Werner Holtfreter wrote:

Dai_trying, you have searched the relevant files for desktop configuration. Do you think, they are well ordered? For me it is chaos. For example, it is crazy to put the kmail maildir deep in a hided directory. I want to see it and backup it and I could see it in my first Linux Distribution Suse a lot of years ago. One path for configuration of all programs, splitted in one sub path for each program and one path for configuration of desktop environment - and your work would be superfluous. But I am not a programmer, could be, it is more complicated and we need a registry ;-)

My backup utility only backs-up the configuration files set by the system and I have no control as to whether they are hidden or their locations, as for having a registry... I can only say that this appears to me (I could be wrong) this has been one of the reasons Windows suffers from so much malware/virus/etc, so it does not (IMO) seem a good idea.

And I would like to say thanks for your feedback on themebackup, it is greatly appreciated in order to make it better for everyone. smile

Offline

#7 2017-02-05 18:24

Werner Holtfreter
Member
Registered: 2016-10-09
Posts: 46

Re: Transfer Desktop Settings to new User

Dai_trying wrote:
Werner Holtfreter wrote:

Dai_trying, you have searched the relevant files for desktop configuration. Do you think, they are well ordered? For me it is chaos. For example, it is crazy to put the kmail maildir deep in a hided directory. I want to see it and backup it and I could see it in my first Linux Distribution Suse a lot of years ago. One path for configuration of all programs, splitted in one sub path for each program and one path for configuration of desktop environment - and your work would be superfluous. But I am not a programmer, could be, it is more complicated and we need a registry ;-)

I have no control as to whether they are hidden or their locations, as for having a registry...

Thank you for all explanations. I know, you are not responsible for the order of config-files. I did not want a big discussion about the registry, nevertheless Gnome seems to have a "Gnome-Registry" :-) I want to know only your meaning about order or chaos in the hided user files.

I had a look in the source file. I don't understand Python, but I thought I can find a long list of files to store. Is this short part the selector of files?:

    def Do_Backup(self):
        global backup_file_name
        backup_file_name = ""
        rf_list = []
        if os.path.exists(home +"/.trinity/share/config/khotkeysrc"):
            rf_list.append(home +"/.trinity/share/config/khotkeysrc")
        start_num = 1
        tar = tarfile.open("/usr/share/apps/q4os_system/q4home.tar")
        for tarinfo in tar:
            this_file = os.path.join(home, tarinfo.name[2:])
            if tarinfo.isreg():
                if os.path.exists(this_file):
                    rf_list.append(this_file)
        tar.close()


        while os.path.exists(os.path.join(full_path, file_name + "%03d" % start_num + ".tar.gz")):
            start_num+=1
        file_with_path = os.path.join(full_path, file_name + "%03d" % start_num + ".tar.gz")

        backup_file_name = file_with_path

        with tarfile.open(file_with_path, "w:gz") as tar:
            for name in rf_list:
                    tar.add(name)

Offline

#8 2017-02-05 20:09

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Transfer Desktop Settings to new User

Werner Holtfreter wrote:

I want to know only your meaning about order or chaos in the hided user files.

I don't really pay any notice to the file locations or whether they are hidden or not, when i need a file I usually search using the command-line (locate) and get back results including hidden files. I guess it could be considered chaotic if you are seeking to keep everything on the system more uniformed.

Werner Holtfreter wrote:

I had a look in the source file. I don't understand Python, but I thought I can find a long list of files to store. Is this short part the selector of files?:

Not exactly, I use the tar file provided by the q4os team for restoring the desktop (/usr/share/apps/q4os_system/q4home.tar) and use this as a list for backing up. (python list = rf_list in my code)
The code you posted was from the automatic backup script, if you want to see the actual program code it can be found in /usr/share/daithemebackup/daithemebackup.py

105    tar = tarfile.open("/usr/share/apps/q4os_system/q4home.tar") ## use q4os archive
106    for tarinfo in tar:                                          ## loop all files
107        this_file = os.path.join(home, tarinfo.name[2:])         ## joins user path to filename
108        if tarinfo.isreg():                                      ## checks file is a regular file
109            if os.path.exists(this_file):                        ## check file exists
110                rf_list.append(this_file)                        ## add existing file to list (rf_list)
111    tar.close()                                                  ## close tar file when complete

This code section creates a list of files that exist on your system that are also contained in the q4os archive file in preparation for backup. If you would like to see the list of files that have been selected you could insert this at line 112

    print(rf_list)

Make sure you use 4 spaces at the beginning of the line and do not use tab. Save the file and then start the program from the command line daithemebackup, now when you create a backup the list of files used will be printed in the terminal. Obviously if you start from the normal menu you will not be able to see the output.

HTH

Offline

#9 2017-02-05 21:40

Werner Holtfreter
Member
Registered: 2016-10-09
Posts: 46

Re: Transfer Desktop Settings to new User

I should stop to ask about things over my horizon. Perhaps the last question: You are using the list of Q4OS, OK. But you wrote, you add some files for the tar.gz. How do you do that?

Thanks for your patient.

Offline

#10 2017-02-05 21:59

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Transfer Desktop Settings to new User

I don't mind anyone asking questions that I can answer, it's the ones I can't answer that I don't like big_smile

If you mean programatically:

At line 88 (function create_new_backup) the config file is opened, the next 14 lines check the contents of the file and add any line containing a valid file name to the list all_files, then at line 113 it adds any files that are not already in rf_list to that list.

If you mean you want to add file(s) to the config file, then simply edit the file /home/user/.config/daithemebackup/config.file and add the files to the ones that are already in there. And don't forget to read the notes in the config.file regarding how to write the file path.

HTH

Offline

#11 2017-02-06 00:13

Werner Holtfreter
Member
Registered: 2016-10-09
Posts: 46

Re: Transfer Desktop Settings to new User

In  /home/user/.config/daithemebackup/ I can find only some themebackup_xxx.tar.gz

I searched the whole hard disc, no one "config.file" exist.

Offline

#12 2017-02-06 00:57

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Transfer Desktop Settings to new User

The file will exist in two places:
1.) /usr/share/daithemebackup/config.file this is the file used by the program to copy to the 2nd location if it does not exist
2.) /home/$USER/.config/daithemebackup/config.file This is created when you run the program for the first time (or if it does not exist for some other reason) using the file in the 1st location.

Please do not modify the 1st location file as it will not be read by the program for backup, instead use the 2nd location for adding custom files for backup.

If you cannot find this file and you have already created a backup then I have to assume you have run the program already so it should exist. But I am thinking you may have run the daithemebackup.auto script which I have just noticed does not utilize the config file (I will update this and make new release available soon) try running daithemebackup either from the command-line or from the menu Programs->Dai's Scripts->Theme Backup and this will create the file for you. I have double checked this and it definitely works on all my systems...

If you are looking for the file when you select Restore From Backup File then you will not see the config.file as the file selector dialog only shows tar.gz files. simply type

ls ~/.config/daithemebackup/

and it should show the config file.

Offline

#13 2017-02-06 01:17

Werner Holtfreter
Member
Registered: 2016-10-09
Posts: 46

Re: Transfer Desktop Settings to new User

The config.file don't exist on both places.

I started your script from the menue and it produced one additional backup, but no config.file, as you can see:

werner@zuse:~$ ls ~/.config/daithemebackup/
themebackup_001.tar.gz  themebackup_002.tar.gz  themebackup_003.tar.gz
werner@zuse:~$ ls ~/.config/daithemebackup/
themebackup_001.tar.gz  themebackup_002.tar.gz  themebackup_003.tar.gz  themebackup_004.tar.gz
werner@zuse:~$

Offline

#14 2017-02-06 01:30

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Transfer Desktop Settings to new User

I think you are either :

1.) Using an older version of Theme Backup

or

2.) Running the auto script instead of the full program.

You should be using version 0.0.2-10 and you can check with this command

daithemebackup -v

And if you are typing daithemebackup_auto to run the program it would explain why you get a new backup each time, just type daithemebackup or run the program from the menu and it will not create a new backup each time unless you tell it to. Simply starting the GUI will produce the required file (with version 0.0.2-10).

Offline

#15 2017-02-06 09:28

Werner Holtfreter
Member
Registered: 2016-10-09
Posts: 46

Re: Transfer Desktop Settings to new User

As you can see, daithemebackup -v produces some warnings ( I don' know why) but not version output. I istalled the script 2017-02-04, you can see the date of files in the following result, the year is 2016:

werner@zuse:~$ daithemebackup -v
Fontconfig warning: "~/.config/fontconfig/fonts_q4os.conf", line 19: Having multiple values in <test> isn't supported and may not work as expect
Fontconfig warning: "~/.config/fontconfig/fonts_q4os.conf", line 72: Having multiple values in <test> isn't supported and may not work as expect
Fontconfig warning: "~/.config/fontconfig/fonts_q4os.conf", line 103: Having multiple values in <test> isn't supported and may not work as expec
Fontconfig warning: "~/.config/fontconfig/fonts_q4os.conf", line 125: Having multiple values in <test> isn't supported and may not work as expec
Fontconfig warning: "~/.config/fontconfig/fonts_q4os.conf", line 210: Having multiple values in <test> isn't supported and may not work as expec
Fontconfig warning: "~/.config/fontconfig/fonts_q4os.conf", line 298: Having multiple values in <test> isn't supported and may not work as expec
Fontconfig warning: "~/.config/fontconfig/fonts_q4os.conf", line 19: Having multiple values in <test> isn't supported and may not work as expect
Fontconfig warning: "~/.config/fontconfig/fonts_q4os.conf", line 72: Having multiple values in <test> isn't supported and may not work as expect
Fontconfig warning: "~/.config/fontconfig/fonts_q4os.conf", line 103: Having multiple values in <test> isn't supported and may not work as expec
Fontconfig warning: "~/.config/fontconfig/fonts_q4os.conf", line 125: Having multiple values in <test> isn't supported and may not work as expec
Fontconfig warning: "~/.config/fontconfig/fonts_q4os.conf", line 210: Having multiple values in <test> isn't supported and may not work as expec
Fontconfig warning: "~/.config/fontconfig/fonts_q4os.conf", line 298: Having multiple values in <test> isn't supported and may not work as expec
creating new backup file
werner@zuse:~$ ls ~/.config/daithemebackup/
themebackup_001.tar.gz  themebackup_002.tar.gz  themebackup_003.tar.gz  themebackup_004.tar.gz  themebackup_005.tar.gz
werner@zuse:~$ daithemebackup_auto
                # NO RECOGNIZABLE REACTION
werner@zuse:~$ ls -l /usr/share/daithemebackup/*
-rw-r--r-- 1 root root 1861 Okt 17 14:57 /usr/share/daithemebackup/Dai_Logo64.png
-rw-r--r-- 1 root root 3859 Okt 17 14:57 /usr/share/daithemebackup/daithemebackup.py
-rw-r--r-- 1 root root 2723 Okt 17 14:57 /usr/share/daithemebackup/themebackup.py
werner@zuse:~$

THE FIRST LINES OF THEMEBACKUP.PY:

# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'themebackup.ui'
#
# Created: Sun Oct 16 14:43:51 2016
#      by: PyQt5 UI code generator 5.3.2
#
# WARNING! All changes made in this file will be lost!

Offline

#16 2017-02-06 09:38

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 4,247
Website

Re: Transfer Desktop Settings to new User

The 'Fontconfig warning ...' is a Q4OS issue, even minor with no real impact. You can safely ignore these warnings.

Offline

#17 2017-02-06 10:17

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Transfer Desktop Settings to new User

The file you are using (themebackup.py) is the GUI generating code only.
type into a terminal

cat /usr/share/daithemebackup/daithemebackup.py | grep ^VERSION

and that should give you the version. but I'm quite certain you have an old version...

Offline

#18 2017-02-06 10:24

bin
Member
From: U.K.
Registered: 2016-01-28
Posts: 1,300

Re: Transfer Desktop Settings to new User

This is part of the contents of the file in question

<match target="font">
<test qual="any" name="family" compare="eq">
  <string>Franklin Gothic Medium</string>
  <string>Frutiger Linotype</string>
  <!-- Lucida Sans Unicode has no italic and uses artificial oblique -->
  <string>Lucida Sans Unicode</string>
</test>
<test qual="any" name="pixelsize" compare="less_eq">
  <double>13.4</double>
</test>
<test qual="any" name="weight" compare="less_eq">
  <const>medium</const>
</test>

What happens is that in the good old days the line:-
<test qual="any" name="family" compare="eq">

would then apply to a list of fonts following it within the same <test>... </test> section.

If you really want to remove the error message then you simply have to edit the file and put:-
<test qual="any" name="family" compare="eq"> before each font and </test> after - thus

<match target="font">
<test qual="any" name="family" compare="eq">
  <string>Franklin Gothic Medium</string>
</test>
<test qual="any" name="family" compare="eq"> 
<string>Frutiger Linotype</string>
</test>
  <!-- Lucida Sans Unicode has no italic and uses artificial oblique -->
<test qual="any" name="family" compare="eq">
<string>Lucida Sans Unicode</string>
</test>
<test qual="any" name="pixelsize" compare="less_eq">
  <double>13.4</double>
</test>
<test qual="any" name="weight" compare="less_eq">
  <const>medium</const>
</test>.............................rest of file

I gave up on this after a while as it's pretty pointless smile

Offline

#19 2017-02-06 10:34

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Transfer Desktop Settings to new User

I think I have found the cause of the problem, on my website I have the old version 0.0.2-4. I will upload the newer version today and give my apologies for not spotting this sooner. roll

EDIT:
Website updated with Version 0.0.2-10 0.0.2-11 Again my apologies for this oversight.

Last edited by Dai_trying (2017-02-06 14:03)

Offline

#20 2017-02-07 20:59

Werner Holtfreter
Member
Registered: 2016-10-09
Posts: 46

Re: Transfer Desktop Settings to new User

Thank you.

How can I update themebackup?

Offline

#21 2017-02-07 22:07

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Transfer Desktop Settings to new User

You will have to un-install the old version and then install the new one, it can be done either from the command line with

sudo apt-get remove daithemebackup

or you can use synaptic package manager to remove it, or you can use the un-install script from the menu Programs->Dai's Scripts->Uninstall Theme Backup and then install the new version.

HTH

Dai

Offline

#22 2017-02-07 22:43

Werner Holtfreter
Member
Registered: 2016-10-09
Posts: 46

Re: Transfer Desktop Settings to new User

Thanks, I have never thought, I can remove a program with the package manager, which is not installed on this way.

Thanks, I can see the config.file.

Dai_trying wrote:
Werner Holtfreter wrote:

Perhaps, I am wrong, but I do not remember password request for installation the program. Can this be?

This is entirely down to how you have permissions set on your system, if you have entered your sudo password recently then you will still have elevated privileges and not be asked again for your password. This can be adjusted by following the instructions in this post.

To test this statement, I reboot immediately before I start the installer from your website

http://dsbnet.tk/tmp/setup_daithemebackup_0.0.2-11_all.esh

It works fine without password request!

Offline

#23 2017-02-07 22:54

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Transfer Desktop Settings to new User

Yes indeed it does! I thought I had to enter password before but obviously not... I can force the installer to request the user password, so that would be the solution and will be fixed in the next release. Thanks for pointing it out. smile

Offline

#24 2017-02-07 23:14

Werner Holtfreter
Member
Registered: 2016-10-09
Posts: 46

Re: Transfer Desktop Settings to new User

Please, do not so. It would cover up a serious security issue in Q4OS: Possibility of Installation in a root directory without password! (If we would want this, we would run Windows.)

Offline

#25 2017-02-08 10:01

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Transfer Desktop Settings to new User

I wouldn't say it's a security issue, it's a configurable option of the q4os installer. I had it set to not ask for a password and can change it to ask by setting it accordingly.

Offline

Board footer

Powered by FluxBB