Page 1 of 1

Have GUI skills? Can you help? Easy desktop icons setup!

Posted: Tue 16 Dec 2014, 21:56
by gcmartin
@StemSee has appealed to the forum for someone with GUI skills to take his terminal commands into a GUI. One would assume this to land somewhere in a PUP's menu.

His appeal is here and the terminal commands are here.

Would someone with GUI skills consider taking a look for him?

Posted: Fri 19 Dec 2014, 15:12
by Rattlehead
StemSee mentions a GUI somewhere in his thread, so maybe this is no longer necessary, but I saw this post and decided to try my hand... A very rudimentary script, but maybe of profit for a user who knows nothing about terminals.

Code: Select all

#!/bin/bash
#
#
check_prep () {
	#Checks if nicons has already gone through the prep (it must be run 3 times), otherwise does the prep
	if [ ! -f /tmp/niconsready ] 
	then 
		nicons
		nicons
		nicons
		echo > /tmp/niconsready
	fi
}
function draw_gui () {
export MAIN_DIALOG='
<frame NICONS>
 <vbox>
  <hbox>
    <button>
      <label>Arrange Icons</label>
      <action>rxvt -e nicons arrange</action>
    </button>
    <button>
      <label>Icons On-Off</label>
      <action>nicons</action>
      <action>exit</action>
    </button>
  </hbox>
  <hbox>
    <button>
      <label>Save Current Configuration</label>
      <action>nicons save</action>
    </button>
    <button>
      <label>Load Configuration</label>
      <action>nicons load</action>
    </button>
  </hbox>
  <hbox>
    <button>
      <label>Reset</label>
      <action>nicons reset</action>
    </button>
   <button ok></button>
  </hbox>
 </vbox>
 </frame>
'

gtkdialog --program=MAIN_DIALOG

}

check_prep
draw_gui

exit 


Issues:
1:for some reason, after upgrading to version 2.4., the save and load commands have stopped working. "nicons load" just leaves an empty desktop, and when you run "nicons" again, it returns to the icons existing before becoming blank, not the ones saved with "nicons save".

2:For some reason, the "cross" arrangement does not work either... Blank desktop too

Posted: Fri 19 Dec 2014, 20:13
by stemsee
@rattlehead

Hola hombre! Gracias por su obra! Me parece esta muy bien.

Yes if you look at some of the functions they have in the first three or four lines the word 'nicons' this was to turn to the iconless desktop, but that was also in the filesfn.... it is fixed now and I will upload 2.5 after a bit more testing. For load function must install desktopiconarrangement.pet by Trio, my own script didn't work and I don't know why!!!


Your gui is a start, but I envisage a gui with dials or sliders to alter the possible variables for positioning X,y, and number of icons, and radius-+, and start point, and distance between icons, and the ability to chain functions together. Quite advanced!

Posted: Sat 20 Dec 2014, 10:31
by stemsee
Thanks @ Rattlehead

You got me started now!

Code: Select all

#!/bin/bash
#
#
check_prep () {
   #Checks if nicons has already gone through the prep (it must be run 3 times), otherwise does the prep
   if [ ! -f ~/Choices/ROX-Filer/ppin ]
   then
   nicons
   fi
}
function draw_gui () {
export MAIN_DIALOG='
<frame NIcons>
 <vbox>
  <hbox>
    <button>
      <label>Arrange Icons</label>
      <action>rxvt -e nicons arrange</action>
    </button>
    <button>
      <label>Icons On-Off</label>
      <action>nicons</action>
      <action>exit</action>
    </button>
  </hbox>
  <hbox>
    <button>
      <label>Save Current Configuration</label>
      <action>nicons save</action>
    </button>
    <button>
      <label>Load Configuration</label>
      <action>nicons load</action>
    </button>
  </hbox>
  <hbox>
    <button>
      <label>Reset</label>
      <action>nicons reset</action>
    </button>
    <button>
      <label>Repo</label>
      <action>nicons repo</action>
      <action>exit</action>
    </button>
    <button>
      <label>Drives</label>
      <action>nicons d</action>
      <action>exit</action>
    </button>
    <button>
      <label>Two iconed Desktops </label>
      <action>nicons two</action>
      <action>exit</action>
    </button>
    <button>
      <label>Exit Two</label>
      <action>nicons pip</action>
      <action>exit</action>
    </button>
   <button ok></button>
  </hbox>
 </vbox>
 </frame>
'

gtkdialog --program=MAIN_DIALOG

}

check_prep
draw_gui

exit 

Posted: Sun 21 Dec 2014, 11:38
by stemsee
I have the basic functions working from gui interfaces now, Including style layouts selection, load and save (got my original efforts working = a bit faster than desktopiconmanager). Just one small bug to work out.

Posted: Mon 22 Dec 2014, 11:48
by Rattlehead
Hey Stemsee,

thank you for your kind words, I'm glad that my short script got you inspired. Muy amable!

I've tried the new gui and found some issues (maybe it's because I run Slacko 5.5., and the GTK dialog versions change from one puppy to another, something of that kind).

When I press 'repo', a white screen with numbers appears only for a second, then there is a blank gtkdialog screen (see screenshot) that cannot be closed and have to be killed. The computer becomes sluggish and the desktop blinks from time to time. This keeps on happening after killing the gtk screen, so there is still something going on in the wings. The only way to get out of this mess is getting out of X and then xwin again into it...

The same sluggish+blinking behavior happens with 'Drives' and 'Two iconed Desktops'. 'Reset' works fine, though.

It seems there is still some way to go before prime time... :roll:

Posted: Mon 22 Dec 2014, 22:33
by stemsee
Try this latest gui.

Note the script has undergone more development but not all features working with the gui. But sav and load and background setting works.i

Code: Select all

#!/bin/bash
#
#
check_prep () {
   #Checks if nicons has already gone through the prep (it must be run 3 times), otherwise does the prep
   if [ ! -f ~/Choices/ROX-Filer/ppin ]
   then
   nicons
   fi
}
function draw_gui () {
export MAIN_DIALOG='
<frame NIcons-1.6>
 <vbox>
  <hbox> 
	<button>
      <label>Switch Pins</label>
      <action>nicons</action>
      <action>exit</action>
    </button>
    <button>
		<label>Layout Style</label>
		<action>nicons arrange</action>
		      <action>exit</action>
		</button>
   <button>
      <label>Icon Repo</label>
      <action>nicons repo</action>
      <action>exit</action>
    </button>
    <button>
      <label>Reset All</label>
      <action>nicons reset</action>
      <action>exit</action>
    </button>
  </hbox>
  <button>
      <label>Refresh Drives</label>
      <action>nicons pevent</action>
    </button>
    <button>
      <label>Layout Styles Including Drives</label>
      <action>nicons d</action>
      <action>exit</action>
    </button>
    <button>
      <label>Strip Icon Labels</label>
      <action>nicons noname</action>
      <action>exit</action>
    </button>
    <button>
	<label>Two PuppyPins</label>
	<action>nicons two</action>
	<action>exit</action>
	</button>
    <button>
    <label>Exit Two Pins</label>
    <action>nicons pip</action>
    </button>
    <button>
      <label>Remove All Icons</label>
      <action>nicons removeall</action>
    </button>
    <button>
      <label>Create/Add Icon/Repo</label>
      <action>nicons add</action>
    </button>
    <hbox>
    <button>
      <label>Save Current Layout</label>
      <action>nicons save</action>
    </button>
    <button>
      <label>Load Saved Layout</label>
      <action>nicons load</action>
    </button>
  </hbox>
  <hbox>
  <button>
    <label>BackGround Wallpaper</label>
    <action>nicons loadbg</action>
    </button>
   <button ok></button>
   <button cancel></button>
  </hbox>
 </vbox>
 </frame>
'

gtkdialog --program=MAIN_DIALOG

}

check_prep
draw_gui

exit

Posted: Tue 23 Dec 2014, 13:14
by Rattlehead
Hey Stemsee, here is my new 'report' (hasn't the new gui become too complicated, btw?)


Working well
========

*Switch pins

*Reset all

*Strip icons labels

*Two puppy pins

*Exit two pins

*Remove all icons

*Background paper


Issues
====

*Layout style - Does nothing

*Icons repo - White screen with numbers for a second then blank gtk
window+sluggishness that requires to go out of X and back again

*Layout styles including drives - blank gtk window+sluggishness

*Create/Add Icon/Repo - Shows for only 1 second a rox-filer screen (I think it is /usr/share/renamed)

*Save current layout - Does nothing

*Load saved layout - Does nothing


Not sure
=====

*Refresh drives - Does nothing - What is it supposed to do?

Posted: Tue 23 Dec 2014, 17:38
by stemsee
Try this updated nicons.gz (fake .gz extension)

Refresh drives causes puppy_event to refresh drive icons. It works for me and depends on your desktop drive icon manager settings!

Layout Style - does nothing in 'Two Pins' mode. (some styles not working right now, but I know how to fix them.) DEDPENDECY is YAD (newer version)

Also Include Drives Layout works in term.

Icons Repo - only works after create repo.

Posted: Wed 24 Dec 2014, 01:47
by stemsee
Nicons-2.6 with GUI (niui)

Simplified, but cost three pre-set layouts.

Posted: Wed 24 Dec 2014, 12:44
by LazY Puppy
Hi.

I had downloaded 2.6 just to examine the code for the refresh of the drive icons. But when I'm clicking the button to refresh the drive icons, nothing seems to happen.

Do I need to change anything first on the desktop or drive icons?

Posted: Wed 24 Dec 2014, 13:40
by trio
RSH,

Download and find the refresh drive icons from my desktop icon arrangement.

Posted: Wed 24 Dec 2014, 18:38
by stemsee
Hi @RSH

This is the code for drive refresh

Code: Select all

if [ "$1" = pevent ]; then
pevencl () {
	if [[  ! "$(pidof pup_event_frontend_d)" ]] ;then
	pup_event_frontend_d &
	fi
[[ -x /root/Startup/xonclock* ]] && /root/Startup/xonclock*
exit
}
pevencl
fi
It works for me. What are your settings in Menu>Desktop>Desktop Drives Icon Manager ?

Posted: Wed 24 Dec 2014, 19:18
by stemsee
By the way the three more surround presets are available using command line

Code: Select all

nicons add
Here is a a bug fix for 'Bottom' Layout that i didn't notice in 2.6

There is a lot of repeated code in my script, but when I reduced everything to variables it didn't work!! Even adding the gui caused big problems. So I will just leave it for the moment.

nicons-2.7

Posted: Wed 24 Dec 2014, 22:25
by trio
https://github.com/puppylinux-woof-CE/w ... entmanager

RSH, you'll find the refresh code at github (link above). I made the changes for future woof-CE built. Stemsee did not adopt the code from "desktop icon arrangement" fully, he just stated that he wanted to incorporate some of my code, so I didn't explain cuz I wasn't asked. I got the code adopting (with long testing and modification) from shinobar's "refresh desktop"

Regards

Posted: Wed 24 Dec 2014, 22:32
by stemsee
ditto

"Due credit where credit is due"

Posted: Thu 25 Dec 2014, 00:02
by trio
stemsee wrote:"Due credit where credit is due"
I really don't need credit. Just leading RSH to the right code

Posted: Thu 25 Dec 2014, 12:30
by Rattlehead
Try this updated nicons.gz (fake .gz extension)
Sorry if this is very obvious, but what am I supposed to do with this file? Turn the .gz into .pet and then run it? I though I'd ask before shooting myself in the foot...

Happy holidays to everybody :)

Posted: Thu 25 Dec 2014, 13:30
by stemsee
Rattlehead

that nicons.gz script is now obsolete, download the subsequent Nicons-2.7.pet. Remove previous version first then install this newer one!

Feliz Compleannos Jesus!

Posted: Thu 25 Dec 2014, 21:30
by stemsee
updated to 1.8

Added delete wallpapers function.


see first post for .pet