You are not logged in.
I need to clone all of the settings in the root account to a less priveledged account (or always run as root, I suppose). Apparently, it isn't a simple matter of copying all the files in the /root/ directory to the new user's home directory and giving ownership of them to the new user. So how do I achieve this transfer?
Xfce version is 4.4.3, distro is Arch Linux.
Long explanation of what I tried:
I know one is not supposed to run as root. Out of laziness I recently set up a box, including X with XFCE4 as my desktop environment, from the root account. After I installed sudo I created a less privileged user, copied all of the files, including hidden files, from /root/ to /home/newuser/ and gave ownership of all files in /home/newuser (including the hidden ones) to newuser. Nonetheless, Xfce starts in a very basic configuration, incomplete, in fact. The cursor, for example, is the default xwm ugly X. When I kill X there are a number of errors on the screen that don't show up in the Xorg log file. Here are a couple examples:
(xfdesktop:5425): libxfce4util-CRITICAL **: Unable to create base directory /root/.cache/xfce4/desktop. Saving to file /root/.cache/xfce4/desktop/menu-cache--etc-xdg-xfce4-desktop-menu.xml.rc is likely to fail.
and
(xfdesktop:5425): libxfce4util-CRITICAL **: Unable to open file /root/.cache/xfce4/desktop/menu-cache--etc-xdg-xfce4-desktop-menu.xml.rc.5425.tmp for writing: Permission denied
What do I need to do?
Offline
Kinda obvious, some of the files must have /root as the home dir, grep/poke through ~/.config/ stuff and change as you find'em
Offline
What should have happen when you created a new user was all the basic configurations are copied from /etc/skel and then you would start from there.
But it's all right, when you're all in pain and you feel the rain come down
It's alright, when you find your way, then you see it disappear
It's alright....
Chris Cornell
Online
I'm pretty sure settings aren't copied from /etc/skel/, rather /etc/xdg/xfce4, /usr/share/xfce4/ and a few other places
Offline
I wrote the following shell script to solve this issue. It worked fine for me on several occasions.
Copy the code into a text editor and save it as copy-config2user
Make the file executable with chmod +x copy-config2user
Execute it by typing ./copy-config2user USERNAME at the command line.
The script is very safe to use as it has some built-in checks.
One can add more copyitem lines to copy the configuration of other programs as well.
#!/bin/bash
<<DESCRIPTION
copy-config2user is a shell command that copies one's desktop configuration files
to another specified user.
Usage: copy-config2user USERNAME
DESCRIPTION
<<COPYRIGHT
Copyright (C) 2012 Serge YMR Stroobandt
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
COPYRIGHT
<<CONTACT
See user on4aa on https://forum.xfce.org/viewtopic.php?id=4168
CONTACT
TOUSER=$1
function copyitem() {
ITEM=$1
echo; echo "Deleting $ITEM of user $TOUSER..."
sudo rm -Rv /home/$TOUSER/$ITEM
echo; echo "Copying $ITEM of user $USER to user $TOUSER..."
sudo cp -av /home/$USER/$ITEM /home/$TOUSER/$ITEM
sudo chown -R $TOUSER:$TOUSER /home/$TOUSER/$ITEM
}
if [ -z $1 ] || ! [ -d /home/$TOUSER ] || [ $USER = $TOUSER ]; then
echo "Please, specify the user who will receive your desktop configuration."
else
copyitem ".config/autostart/"
copyitem ".config/Terminal/"
copyitem ".config/Thunar/"
copyitem ".config/xfce4/"
fiLast edited by on4aa (2012-05-30 19:14:55)
Are my methods unsound?
Have you ever considered any real freedoms? Freedoms from the opinion of others... even the opinions of yourself?
Colonel Walter E. Kurtz in "Apocalypse Now"
Offline
[ Generated in 0.018 seconds, 7 queries executed - Memory usage: 530.33 KiB (Peak: 530.95 KiB) ]