ShowHideIcons-v1.8 30/11/2014
Posted: Tue 18 Nov 2014, 20:24
This is a simple app with one script in ~/my-applications/bin/nicons very simple but works a treat.
v1.8
v1.8
READ-ONLY Archive
https://oldforum.puppylinux.com/
exhibits your total lack of comprehension.Menu > Desktop > Desktop Drives Icon Manager
Code: Select all
nicons
Code: Select all
nicons
Code: Select all
nicons
Code: Select all
nicons add
Code: Select all
nicons remove
Code: Select all
nicons removeall
Code: Select all
nicons two
Code: Select all
nicons pip
Code: Select all
nicons reset
Code: Select all
##!/bin/bash
#copyright (c) 2014 M arcos Contant
#nicons # first use creates flag and backs-up puppypin, but no apparent change
#nicons # second use switches to iconless dektop
#nicons # third use switches to iconified desktop
#nicons reset # restores original desktop and deletes script created pins
#nicons remove # helps user remove icon/s from iconified desktop
#nicons removeall # removes all icons from iconified pin. Blank page for adding icons.
#nicons noicons # recreates pristine PuppyPin0 (iconless desktop) from script.
#nicons two #copies iconless pin to puppypin; giving two iconifiable desktop pins.
#nicons pip # resets nicons two.
#nicons add #for rox window of icons from applications dir without .desktop extension.
#(nicons add/remove is temporary for iconless desktop but persistent for iconified desktop, except with nicons two)
pp0 () {
echo '<?xml version="1.0"?>' > ~/Choices/ROX-Filer/PuppyPin0
echo "<pinboard>" >> ~/Choices/ROX-Filer/PuppyPin0
echo " <backdrop style="Stretched">/usr/share/backgrounds/default.jpg</backdrop>" >> ~/Choices/ROX-Filer/PuppyPin0
echo \ >> ~/Choices/ROX-Filer/PuppyPin0
echo \ >> ~/Choices/ROX-Filer/PuppyPin0
echo " </pinboard>" >> ~/Choices/ROX-Filer/PuppyPin0
}
if [ ! -e ~/Choices/ROX-Filer/PuppyPin-bak1 ]; then
cp ~/Choices/ROX-Filer/PuppyPin ~/Choices/ROX-Filer/PuppyPin-bak
cp ~/Choices/ROX-Filer/PuppyPin ~/Choices/ROX-Filer/PuppyPin-bak1
fi
if [ "$1" = pip ]; then
rm ~/Choices/ROX-Filer/pip
rm ~/Choices/ROX-Filer/ipp
pp0
fi
if [ -e ~/Choices/ROX-Filer/pip ]; then
pipipp () {
mv ~/Choices/ROX-Filer/pip ~/Choices/ROX-Filer/ipp
mv ~/Choices/ROX-Filer/PuppyPin /tmp/
mv ~/Choices/ROX-Filer/PuppyPin0 ~/Choices/ROX-Filer/PuppyPin
DISPLAY=:0.0 rox --pinboard ~/Choices/ROX-Filer/PuppyPin
gtkdialog-splash -placement top-left -bg blue -text "$(gettext 'Pin 1 of Two iconifiable pins switching.
To remove type - nicons pip - then Enter')" &
SPLASHPID=$!
sleep 2
kill $SPLASHPID 2> /dev/null
exit
}
pipipp
fi
if [ -e ~/Choices/ROX-Filer/ipp ]; then
ipppip () {
mv ~/Choices/ROX-Filer/ipp ~/Choices/ROX-Filer/pip
mv ~/Choices/ROX-Filer/PuppyPin ~/Choices/ROX-Filer/PuppyPin0
cp /tmp/PuppyPin ~/Choices/ROX-Filer/PuppyPin
DISPLAY=:0.0 rox --pinboard ~/Choices/ROX-Filer/PuppyPin
gtkdialog-splash -placement top-left -bg blue -text "$(gettext 'Pin 2 of Two iconifiable pins switching.
To remove type - nicons pip - then Enter')" &
SPLASHPID=$!
sleep 2
kill $SPLASHPID 2> /dev/null
exit
}
ipppip
fi
#if [ "$1" = setup ]; then
set () {
rm ~/Choices/ROX-Filer/PuppyPin-bak
ppbak () {
echo '<?xml version="1.0"?>' > ~/Choices/ROX-Filer/PuppyPin-bak
echo "<pinboard>" >> ~/Choices/ROX-Filer/PuppyPin-bak
echo " <backdrop style="Stretched">/usr/share/backgrounds/default.jpg</backdrop>" >> ~/Choices/ROX-Filer/PuppyPin-bak
echo \ >> ~/Choices/ROX-Filer/PuppyPin-bak
echo \ >> ~/Choices/ROX-Filer/PuppyPin-bak
echo " </pinboard>" >> ~/Choices/ROX-Filer/PuppyPin-bak
echo \ >> ~/Choices/ROX-Filer/PuppyPin-bak
}
ppbak
if [[ -d /usr/shared/renamed ]]; then
rm -r /usr/shared/renamed/
fi
if [[ ! -d /usr/shared/renamed ]]; then
mkdir /usr/share/renamed/
ln -fnv /usr/share/applications/* /usr/share/renamed/ 2> /dev/null
cd /usr/share/renamed/
echo $line | for i in *.desktop; do mv $i `basename $i .desktop`; done 2> /dev/null
fi
DISPLAY=:0.0 rox --pinboard ~/Choices/ROX-Filer/PuppyPin-bak
rox /usr/share/renamed/ &
gtkdialog-splash -placement top-left -bg blue -text "$(gettext 'Drag & arrange all icons to this desktop')" &
SPLASHPID=$!
sleep 4
kill $SPLASHPID 2> /dev/null
gtkdialog-splash -placement top-left -bg blue -text "$(gettext 'Press Enter when finished.')" &
SPLASHPID=$!
sleep 8
kill $SPLASHPID 2> /dev/null
read dummy
nicons
exit
}
#set
#fi
choice () {
if [[ -d /usr/shared/renamed ]]; then
rm -r /usr/shared/renamed/
fi
if [[ ! -d /usr/shared/renamed ]]; then
mkdir /usr/share/renamed/
ln -fnv /usr/share/applications/* /usr/share/renamed/ 2> /dev/null
cd /usr/share/renamed/
echo $line | for i in *.desktop; do mv $i `basename $i .desktop`; done 2> /dev/null
fi
rox /usr/share/renamed/ &
gtkdialog-splash -placement top-left -bg blue -text "$(gettext 'Drag & arrange all icons to this desktop')" &
SPLASHPID=$!
sleep 4
kill $SPLASHPID 2> /dev/null
rm /root/Choices/ROX-Filer/PuppyPin0
cp /root/Choices/ROX-Filer/PuppyPin /root/Choices/ROX-Filer/PuppyPin0
[ -x /root/Startup/xonclock* ] && /root/Startup/xonclock*
exit
}
if [ "$1" = add ]; then
choice && exit
fi
removeicons () {
rm /tmp/rmvtxt
touch /tmp/rmvtxt
echo "Type space separated name of icon/s to remove and press enter"
read rmv < /dev/tty
echo $rmv | tr ' ' '\n' >> /tmp/rmvtxt
while read line
do
sed -i "/$line/d" ~/Choices/ROX-Filer/PuppyPin
done < /tmp/rmvtxt
DISPLAY=:0.0 rox --pinboard ~/Choices/ROX-Filer/PuppyPin
rm /root/Choices/ROX-Filer/PuppyPin0
cp /root/Choices/ROX-Filer/PuppyPin /root/Choices/ROX-Filer/PuppyPin0
[ -x /root/Startup/xonclock* ] && /root/Startup/xonclock*
exit
}
if [ "$1" = remove ]; then
removeicons && exit
fi
removeallicons () {
rm ~/Choices/ROX-Filer/PuppyPin
cp /root/Choices/ROX-Filer/PuppyPin0 /root/Choices/ROX-Filer/PuppyPin
DISPLAY=:0.0 rox --pinboard ~/Choices/ROX-Filer/PuppyPin 2> /dev/null
[ -x /root/Startup/xonclock* ] && /root/Startup/xonclock*
exit
}
if [ "$1" = removeall ]; then
removeallicons && exit
fi
resetpins () {
rm ~/Choices/ROX-Filer/pip
rm -r /usr/shared/renamed/
rm ~/Choices/ROX-Filer/PuppyPin-bak
rm ~/Choices/ROX-Filer/PuppyPin-orig
rm ~/Choices/ROX-Filer/PuppyPin-orig-bak
rm ~/Choices/ROX-Filer/ppin 2> /dev/null
rm ~/Choices/ROX-Filer/nipp 2> /dev/null
rm ~/Choices/ROX-Filer/PuppyPin0 2> /dev/null
rm ~/Choices/ROX-Filer/PuppyPin 2> /dev/null
mv ~/Choices/ROX-Filer/PuppyPin-bak1 ~/Choices/ROX-Filer/PuppyPin 2> /dev/null
DISPLAY=:0.0 rox --pinboard ~/Choices/ROX-Filer/PuppyPin 2> /dev/null
[ -x /root/Startup/xonclock* ] && /root/Startup/xonclock*
exit
}
if [ "$1" = reset ]; then
resetpins
fi
if [ -e ~/Choices/ROX-Filer/nipp ]; then
mv ~/Choices/ROX-Filer/nipp ~/Choices/ROX-Filer/ppin
bd=`grep -e ' <backdrop style' ~/Choices/ROX-Filer/PuppyPin0`
sed -i 3i\ "$bd" ~/Choices/ROX-Filer/PuppyPin-orig 2> /dev/null
sed -i 4\\ ~/Choices/ROX-Filer/PuppyPin-orig
mv ~/Choices/ROX-Filer/PuppyPin-orig ~/Choices/ROX-Filer/PuppyPin
DISPLAY=:0.0 rox --pinboard ~/Choices/ROX-Filer/PuppyPin
elif [ -e ~/Choices/ROX-Filer/ppin ]; then
mv ~/Choices/ROX-Filer/ppin ~/Choices/ROX-Filer/nipp
bd=`grep -e '<backdrop style' ~/Choices/ROX-Filer/PuppyPin`
pp0
if [[ "$1" = noicons ]]; then
pp0 && exit
fi
if [[ "$1" = two ]]; then
rm ~/Choices/ROX-Filer/PuppyPin0
cp ~/Choices/ROX-Filer/PuppyPin ~/Choices/ROX-Filer/PuppyPin0
rm ~/Choices/ROX-Filer/pip
rm ~/Choices/ROX-Filer/ipp
touch ~/Choices/ROX-Filer/pip
exit
fi
sed -i 3i\ "$bd" ~/Choices/ROX-Filer/PuppyPin0 2> /dev/null
sed -i 4\\ ~/Choices/ROX-Filer/PuppyPin0
sed -i 4d ~/Choices/ROX-Filer/PuppyPin0 2> /dev/null
mv ~/Choices/ROX-Filer/PuppyPin ~/Choices/ROX-Filer/PuppyPin-orig
mv ~/Choices/ROX-Filer/PuppyPin0 ~/Choices/ROX-Filer/PuppyPin
DISPLAY=:0.0 rox --pinboard ~/Choices/ROX-Filer/PuppyPin
gtkdialog-splash -placement top-left -bg blue -text "$(gettext 'No Icons')" &
SPLASHPID=$!
sleep 2
kill $SPLASHPID 2> /dev/null
elif [[ ! -e ~/Choices/ROX-Filer/nipp && ! -e ~/Choices/ROX-Filer/ppin ]]; then
touch ~/Choices/ROX-Filer/ppin
fi
[ -x /root/Startup/xonclock* ] && /root/Startup/xonclock*
if [[ ! -e ~/Choices/ROX-Filer/PuppyPin0 ]]; then
cp ~/Choices/ROX-Filer/PuppyPin ~/Choices/ROX-Filer/PuppyPin0
fi
Code: Select all
res=`xrandr | grep -w connected | cut -f3 -d ' ' | cut -f1 -d '+' | tr 'x' ' '`
maxx=`echo $res | cut -f1 -d ' '`
maxy=`echo $res | cut -f2 -d ' '`
lines=`ls -1 /usr/share/renamed | wc -l`
echo "$(((maxx) / 12))"
echo "$(((maxy) / 12))"
varx=1
vary=1
varx=$((varx + 70)) #incremental
vary=$((vary + 70))
y1 x[1-12]
y2 x[1-12]
y15 x[1-20]
Code: Select all
BEGIN {
varx=1;
varx=$((varx + 70));
OFS = "\"";
split("2", Fields);
split("$varx", Replacements);
}
{
while (count++<20)
for (i in Fields) {
for (j in Replacements) {
Replace = Replacements[j];
sub(Replace Replace, $Fields[i]);
}
}
print;
}
BEGIN {
vary=1;
vary=$((vary + 70));
OFS = "\"";
split("4", Fields);
split("$vary", Replacements);
}
{
while (count++<15)
for (i in Fields) {
for (j in Replacements) {
Replace = Replacements[j];
sub(Replace Replace, $Fields[i]);
}
}
print;
}
Code: Select all
#!/bin/bash
rm ~/Choices/ROX-Filer/PuppyPin-formatted
rm /tmp/files
touch /tmp/files
sed -n '3,16p;16q' ~/Choices/ROX-Filer/PuppyPin-bak >> /tmp/files
touch ~/Choices/ROX-Filer/PuppyPin-formatted
varx=10
vary=10
indexx=2
indexy=4
while read line
do
sed -l '/4/d'
varx=$(($varx + 90))
echo $line | awk -F\" -v OFS=\" '{$'$indexx'='$varx'; print }' | awk -F\" -v OFS=\" '{$'$indexy'='$vary'; print }' >> ~/Choices/ROX-Filer/PuppyPin-formatted
done < /tmp/files
Code: Select all
#!/bin/bash
# nested-loop.sh: Nested "for" loops.
rm ~/Choices/ROX-Filer/PuppyPin-formatted
touch ~/Choices/ROX-Filer/PuppyPin-formatted
rm /tmp/files
touch /tmp/files
cat ~/Choices/ROX-Filer/PuppyPin >> /tmp/files
sed -i '1,3d' /tmp/files
sed -i '$d' /tmp/files
#echo $file | head -10 >> /tmp/files
varx=0
vary=0
indexx=2
indexy=4
outer=1 # Set outer loop counter.
for vary in 0 90 170 250 330 410 490 570
do
vary=$(($vary + 1))
inner=1 # Reset inner loop counter.
# Beginning of inner loop.
for varx in 0 90 170 250 330 410 490 570 650 730 810 890 970
do
varx=$(($varx + 1))
cat /tmp/files | awk -F\" -v OFS=\" '{$'$indexx'='$varx'; print }' | awk -F\" -v OFS=\" '{$'$indexy'='$vary'; print }' >> ~/Choices/ROX-Filer/PuppyPin-formatted
echo "Pass $inner in inner loop."
let "inner+=1" # Increment inner loop counter.
# End of inner loop.
let "outer+=1" # Increment outer loop counter.
echo # Space between output blocks in pass of outer loop.
unset varx
done
done
exit 0