Posts: 26
enzo
Joined: 09 Feb 2017
#1
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- __{{emoticon}}__ Can anyone help me?
Posts: 4,164
rokytnji
Joined: 20 Feb 2009
#2
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:
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://postimage.io/"
linktext was:"https://postimage.io/"
====================================

to post my screenshots.
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#3
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?
anticapitalista
Posts: 5,955
Site Admin
Joined: 11 Sep 2007
#4
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?
Posts: 26
enzo
Joined: 09 Feb 2017
#5
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!
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#6
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: Select all

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: Select all

conky
      /etc/skel/.conkyrc

Code: Select all

GTK2 theme  ----------------------------- ???
      /etc/skel/.gtkrc-2.0.mine
      /etc/skel/.gtkrc-2.0
      /etc/skel/.gtkrc

Code: Select all

GTK3 theme
      /etc/skel/.config/gtk-3.0/settings.ini

Code: Select all

JWM   ------------- (errorcheck) possibility that the default THEME has been deleted
      /etc/skel/.jwmrc
      /etc/skel/.jwm/*

Code: Select all

 IceWM      -------------- themes NOT stored in etc subfolder
      /etc/skel/.icewm/*

Code: Select all

fluxbox
      /etc/skel/.fluxbox/*          -------------- themes NOT stored in etc subfolder

Code: Select all

rox
      /etc/skel/.config/roxterm.sourceforge.net/*
      /etc/skel/.config/rox.sourceforge.net/*

Code: Select all

spacefm
      /etc/skel/.config/spacefm/*          ------------ dir contains only one file, named `session`

Code: Select all

repositories
     ? ? ?

Code: Select all

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
Posts: 1,062
Dave
Joined: 20 Jan 2010
#7
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.
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#8
> 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.
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://github.com/antiX-Dave/desktop-defaults"
linktext was:"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.
Posts: 1,062
Dave
Joined: 20 Jan 2010
#9
Not desktop-defaults but actually in user-management in the cc, I think it was the repair section.

========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://github.com/antiX-Dave/user-management"
linktext was:"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.
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#10
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.

========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"antix.freeforu ms.org/posting.php?mode=quote&f=58&p=47842"
linktext was:"antix.freeforu ms.org/posting.php ... 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: Select all

#! /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
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#11
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)
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#12
related reading, here's a current (18days ago) reddit topic
"Does Linux have refresh or reset?" (88 replies)