It is currently Thu Jun 29, 2017 12:53 pm



Welcome
Welcome to antiX-forum.

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, join our community today!


Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: back to the first settings
PostPosted: Mon Feb 27, 2017 3:34 pm 
Offline

Joined: Thu Feb 09, 2017 11:36 pm
Posts: 18
Hi folks, first: i like the new experience with "antix"! Now, after playing with it, i will back to the "first" settings on the desktop, with the buttons on left side down and time on the right, but can not find this- :oops: Can anyone help me?


Top
 Profile  
 
 Post subject: Re: back to the first settings
PostPosted: Mon Feb 27, 2017 4:29 pm 
Offline
User avatar

Joined: Fri Feb 20, 2009 3:44 am
Posts: 4017
Location: Pecos, Texas
Got a screenshot of what you are saying. Usually. Anytime I make any changes to text files anymore. I make a backup of the original before I start playing around.

Offsite image hosting site I use on the forum: https://postimage.io/
to post my screenshots.

_________________
Linux Registered User # 475019
Linux at Home courses
How to Search for AntiX solutions to your problems


Top
 Profile  
 
 Post subject: Re: back to the first settings
PostPosted: Mon Feb 27, 2017 9:32 pm 
Offline

Joined: Thu Feb 09, 2012 7:29 am
Posts: 1194
Seems like the goal is to "Restore desktop defaults".
I'm not aware of any existing tool/script which handles that task, but I'll attempt creating one.
With attention toward building such a tool:

Would it be safe to copy into place the various config files from /etc/skel/* while the affected user account is logged into a session?
Are any of those files modified during logout?

The reset utility could present a set of checkboxes, or a sequence of questions:
-- [Y/n] restore default conky config ?
-- [Y/n] restore default session autostarts ?
-- [Y/n] restore default jwm settings ?
-- [Y/n] restore default icewm settings ?
-- [Y/n] restore default fluxbox settings ?

What additional granular questions might the tool include?


Top
 Profile  
 
 Post subject: Re: back to the first settings
PostPosted: Mon Feb 27, 2017 9:47 pm 
Offline
Site Admin
User avatar

Joined: Tue Sep 11, 2007 4:55 pm
Posts: 5839
Location: Greece
Original settings can be found in /etc/skel (most are hidden files/folders).

- skidoo -

Some others might include

rox settings
gtk3 and gtk2 settings
desktop-defaults for file-manager, editor, eg in Preferred apps
restore repos?

_________________
Philosophers have interpreted the world in many ways; the point is to change it.


Top
 Profile  
 
 Post subject: Re: back to the first settings
PostPosted: Mon Feb 27, 2017 10:07 pm 
Offline

Joined: Thu Feb 09, 2017 11:36 pm
Posts: 18
I see, there are some ways and ideas to reset and i will copy and test this. Meanwhile, i had solut the proplem with a new booting af "antix" from the cd. Thanks a lot to you, roky, skidoo and antkapitalista!


Top
 Profile  
 
 Post subject: Re: back to the first settings
PostPosted: Tue Feb 28, 2017 10:30 am 
Offline

Joined: Thu Feb 09, 2012 7:29 am
Posts: 1194
The WIP is a single python+pygtk script.
Might need to (find and) bundle a "definitive" set of /etc/apt/sources.list.d/* files

Please review the etc/skel items I've identified, and let me know what is missing (or is incorrect) in this tentative list.

Code:
session-start
      ???   /etc/skel/.desktop-session/wallpaper.conf   (no, b/c the default wallpaper imagefile may not currently exist)
      /etc/skel/.desktop-session/startup
Code:
conky
      /etc/skel/.conkyrc
Code:
GTK2 theme  ----------------------------- ???
      /etc/skel/.gtkrc-2.0.mine
      /etc/skel/.gtkrc-2.0
      /etc/skel/.gtkrc
Code:
GTK3 theme
      /etc/skel/.config/gtk-3.0/settings.ini
Code:
JWM   ------------- (errorcheck) possibility that the default THEME has been deleted
      /etc/skel/.jwmrc
      /etc/skel/.jwm/*
Code:
IceWM      -------------- themes NOT stored in etc subfolder
      /etc/skel/.icewm/*
Code:
fluxbox
      /etc/skel/.fluxbox/*          -------------- themes NOT stored in etc subfolder
Code:
rox
      /etc/skel/.config/roxterm.sourceforge.net/*
      /etc/skel/.config/rox.sourceforge.net/*
Code:
spacefm
      /etc/skel/.config/spacefm/*          ------------ dir contains only one file, named `session`

Code:
repositories
     ? ? ?
Code:
preferred handlers/openers
      /etc/skel/.local/share/applications/mimeinfo.cache
      /etc/skel/.local/share/applications/defaults.list
      /etc/skel/.local/share/desktop-defaults/*
      #
      ??? cp /usr/share/applications/antix/file-manager.desktop $XDG_DESKTOP_DIR
      ??? cp /usr/share/applications/antix/antiX-docs.desktop $XDG_DESKTOP_DIR

Image


Top
 Profile  
 
 Post subject: Re: back to the first settings
PostPosted: Tue Feb 28, 2017 2:44 pm 
Offline

Joined: Thu Jan 21, 2010 12:36 am
Posts: 1041
I might have added something like this to the user manager in the cc... but I only have a faint memory of this. It might be worth a peak for the new utility ; I do not know.

Also rather than hard coding the checkbox options it might be worth parsing through an 'ls' or 'find' of the home directory or skel directory. Having a single build and remove block and use a for loop to run through the directory listing to build the checkbox (should be in a scrolled window) and then another for loop to run through the checkbox list for removing and replacing.

_________________
Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown


Top
 Profile  
 
 Post subject: Re: back to the first settings
PostPosted: Wed Mar 01, 2017 12:03 am 
Offline

Joined: Thu Feb 09, 2012 7:29 am
Posts: 1194
> I might have added something like this to the user manager in the cc... but I only have a faint memory of this.
> It might be worth a peak for the new utility

Yep. https://github.com/antiX-Dave/desktop-defaults antixcc }} Desktop }} Preferred Applications
So, the new utility should probably omit the 'default preferred handlers entry'.
Maybe anticapitalista had something else in mind? (wrote "desktop-defaults for file-manager, editor, eg in Preferred apps")
-=-
There's some sticking point which has bred recurring help requests; offhand, I can't recall exactly what detail.
(? It's necessary to also use galternatives because 'preferred' as specified via /usr/local/bin/desktop-defaults-set is recognized/respected by rox, but not by 'xdg-open'?)


> should be in a scrolled window
As seen in the screenshot, the utility employs a ScrolledWindow. FWIW, it's an immediate child of the window's implicit VBox.
I'm unsure what you're recommending should be done differently.


> rather than hard coding the checkbox options it might be worth parsing through an 'ls' or 'find' of the home directory or skel directory.
> Having a single build and remove block and use a for loop to run through the directory listing to build the checkbox (should be in a scrolled window)
> and then another for loop to run through the checkbox list for removing and replacing.

Whoosh... I'm missing the point, or something.
It's a static set of granular tasks. Static sets of files need to be copied.
Down the road, extending the list of available tasks will involve a simple (30sec) code edit.
Parsing 'ls' output to determine "whatever else" may, or may not, be present... seems moot.


Top
 Profile  
 
 Post subject: Re: back to the first settings
PostPosted: Wed Mar 01, 2017 12:49 am 
Offline

Joined: Thu Jan 21, 2010 12:36 am
Posts: 1041
Not desktop-defaults but actually in user-management in the cc, I think it was the repair section.
https://github.com/antiX-Dave/user-management

Thanks for the reminder though, I have to yet add the ability to desktop-defaults to work with xdg-open / galternatives / see if there is a more standard way of setting defaults. At the time IIRC there was a wash of different ways so I made the utility to use itself / set the mimeapp.list which I think has a new location now and / or method of working with it. So it does need an update.

The second half can be ignored. I was just throwing out ideas of how I was going to look into repair / reset settings in the past via utility. Obviously wear-ever you would like to take your app is up to you. My notes show to do an ls / find of ~/ and for each line outputed by ls / find build a check button and label in the gui.
The user would then check what they wanted to repair / reset and press "apply" making a "user selected" list from the original find/ls based on selections.
The utility would then do an ls of /etc/skel, do a diff against the "user selected" list, make a backup of the current configs that are queued for reset/repair in ~/conf-backup folder, copy what matches the "user selected" from /etc/skel and remove what is "user selected" but not in /etc/skel for regeneration by the program itself. The scrolled window mention was to accommodate for the large size of the list that would be generated by parsing the output of find/ls.

_________________
Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown


Top
 Profile  
 
 Post subject: Re: back to the first settings
PostPosted: Wed Mar 08, 2017 9:57 pm 
Offline

Joined: Thu Feb 09, 2012 7:29 am
Posts: 1194
In response to anticapitalista's suggestion to provide a means of setting/resetting repositories via a gui, I have modded
/usr/local/bin/antixsources.sh
so that it can serve as a "choose repositories" utility (which would, presumably, be launched via controlCentre)

"repositorychooser.sh" is tested/working, but I'm posting to ask whether deb-multimedia repo should be enabled.
I suspect that deb-multimedia should _not_ remain permanently enabled; as is, the utility currently unsets (comments) any deb-multimedia lines.
Quote:
http://antix.freeforums.org/posting.php?mode=quote&f=58&p=47842
dolphin_oracle stated
is a problem when deb-multimedia is left enabled. deb-multi uses its own ffmpeg, among other things


Yes, as is, I expect the GUI will be regarded as too verbose.
Modify it however you wish.
Image

Image

Image

Code:
#! /bin/bash
# File Name: repositorychooser.sh
# Purpose: sets/selects Debian repository (and antiX)
# Author: anticapitalista for antiX, modified by skidoo
# Latest Change: 11 March 2017

TEXTDOMAINDIR=/usr/share/locale
TEXTDOMAIN=repositorychooser

export title="repository selection utility"
info_text=$"This utility enables you to set the Debian + antiX
repositories used for your system, by automatically editing
   /etc/apt/sources.list.d/debian.list   and   /etc/apt/sources.list.d/debian.list
based on your selection in the following (next) dialog window.

IF YOU HAVE PREVIOUSLY HAND-EDITED
   /etc/apt/sources.list.d/debian.list  OR   /etc/apt/sources.list.d/debian.list
YOU SHOULD PROBABLY DO SO AGAIN RATHER THAN RUNNING THIS UTILITY

You can choose between:

Stable (aka 'Jessie')
Testing 
Unstable (aka 'Sid')

This release of antiX defaults to Jessie/Stable and antiX/Stable.
~~~ Testing and Unstable are available for use by EXPERT users ~~~

NOTE:
Changing away from stable should be considered a 'one-way ticket'.
If testing or unstable is currently used (or has been previously),
changing back to stable does not magically rollback/downgrade
any packages already installed on your system."

function edit_sources
{
    #  pre-parse, remove any leading spaces, tab chars, MULTIPLE poundsign chars
    sed -i -r "/deb/   s/^[ \t]+//"  /etc/apt/sources.list.d/debian.list
    sed -i -r "/deb/   s/^[ \t]+//"  /etc/apt/sources.list.d/antix.list
    sed -i -r "/deb/   s/^[#]+/#/"  /etc/apt/sources.list.d/antix.list

    if [ "$jessie" = true ]; then
        sed -i -r "/jessie/   s/^#+//"         /etc/apt/sources.list.d/debian.list
        sed -i -r "/testing/  s/^([^#])/#\1/"  /etc/apt/sources.list.d/debian.list       
        sed -i -r "/sid/      s/^([^#])/#\1/"  /etc/apt/sources.list.d/debian.list
        sed -i -r "/unstable/ s/^([^#])/#\1/"  /etc/apt/sources.list.d/debian.list
        sed -i -r "/deb-src/  s/^([^#])/#\1/"  /etc/apt/sources.list.d/debian.list       

        sed -i -r "/jessie/   s/^#+//"  /etc/apt/sources.list.d/antix.list
        sed -i -r "/testing/  s/^/#/"   /etc/apt/sources.list.d/antix.list
        sed -i -r "/sid/      s/^/#/"   /etc/apt/sources.list.d/antix.list
    fi

    if [ "$testing" = true ]; then
        sed -i -r "/jessie/   s/^([^#])/#\1/"  /etc/apt/sources.list.d/debian.list       
        sed -i -r "/testing/  s/^#+//"         /etc/apt/sources.list.d/debian.list
        sed -i -r "/sid/      s/^([^#])/#\1/"  /etc/apt/sources.list.d/debian.list
        sed -i -r "/unstable/ s/^([^#])/#\1/"  /etc/apt/sources.list.d/debian.list
        sed -i -r "/deb-src/  s/^([^#])/#\1/"  /etc/apt/sources.list.d/debian.list

        sed -i -r "/jessie/   s/^/#/"   /etc/apt/sources.list.d/antix.list
        sed -i -r "/testing/  s/^#+//"  /etc/apt/sources.list.d/antix.list
        sed -i -r "/sid/      s/^/#/"   /etc/apt/sources.list.d/antix.list
    fi

    if [ "$sid" = true ]; then
        sed -i -r "/jessie/   s/^([^#])/#\1/" /etc/apt/sources.list.d/debian.list
        sed -i -r "/testing/  s/^([^#])/#\1/" /etc/apt/sources.list.d/debian.list 
        sed -i -r "/sid/      s/^#+//"        /etc/apt/sources.list.d/debian.list
        sed -i -r "/unstable/ s/^#+//"        /etc/apt/sources.list.d/debian.list
        sed -i -r "/deb-src/  s/^([^#])/#\1/" /etc/apt/sources.list.d/debian.list

        sed -i -r "/jessie/   s/^/#/"   /etc/apt/sources.list.d/antix.list
        sed -i -r "/testing/  s/^#+//"  /etc/apt/sources.list.d/antix.list
        sed -i -r "/sid/      s/^#+//"  /etc/apt/sources.list.d/antix.list
   # ======= NEED CONFIRMATION: SHOULD _ALSO_ ENABLE antix testing when sid/unstable is selected?
    fi

    #  cleanup
    sed -i -r "/deb/   s/^[#]+/#/"  /etc/apt/sources.list.d/antix.list

    #  outcomment any lines mentioning *multimedia repos
    #  because problems arise, regarding ffmpeg et al, if these remain enabled continually/indefinintely
    sed -i -r "/multimedia\.org/   s/^([^#])/#\1/"  /etc/apt/sources.list.d/debian.list   
}

function success
{
   yad --image "info" --center --title "$title" --width 540 --button="OK":1 \
        --text=$"Debian and antiX repositories have been set to  $x

You should now followup by performing an 'apt-get update' operation"
}
######################## CANCEL BUTTON HERE IS MISLEADING ---^

#====================
# main

yad --title "$title" --width 640 --image "question" --center --text="$info_text"
rsp=$?

if [ $rsp != 0 ]; then
    exit 0
fi

# selection dialog (itza RADIO input. returns only ONE item)
ans=$(yad --center --title "$title" --width 400 --height 200 \
             --list --separator=":" --text $"  If you click Cancel, no change will be performed." \
             --radiolist  --column $"Choose" --column $"Repository"\
              TRUE "Jessie"   FALSE "Testing"   FALSE "Sid")
#echo $ans

# transform the list separated by ':' into arr
arr=$(echo $ans | tr ":" "\n")

selected=""
for x in $arr
do
    #echo "> [$x]"
    case $x in
    Jessie)
        jessie='true'
        selected='yes'
        ;;
    Testing)
        testing='true'
        selected='yes'
        ;;
    Sid)
        sid='true'
        selected='yes'
        ;;
    esac   
done

# How could this occur?
if [ -z $selected ]; then
    echo $"No item selected"
    exit 0
fi

edit_sources
success


Top
 Profile  
 
 Post subject: Re: back to the first settings
PostPosted: Wed Mar 08, 2017 11:22 pm 
Offline

Joined: Thu Feb 09, 2012 7:29 am
Posts: 1194
proofreading / afterthoughts:

Wondering whether Testing should be labeled Testing (aka 'Stretch') for sake of consistency.

IMO, it's important to define (in this case 'OK') a button for the final dialog
in order to suppress yad's default inclusion of a (confusing and useless) 'Cancel' button.

Script could be extended to ask whether user has a net connection, offering to automatically perform apt update
(I didn't want to fuss with creating a yad progress dialog)


Top
 Profile  
 
 Post subject: Re: back to the first settings
PostPosted: Fri Apr 28, 2017 11:23 pm 
Offline

Joined: Thu Feb 09, 2012 7:29 am
Posts: 1194
related reading, here's a current (18days ago) reddit topic
"Does Linux have refresh or reset?" (88 replies)
https://www.reddit.com/r/linux/comments ... _or_reset/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
suspicion-preferred