Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 01-06-2012, 08:39 PM   #1
vaniaspeedy
Connoisseur
vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.
 
Posts: 51
Karma: 9502
Join Date: Oct 2010
Location: California
Device: Kindle 3 WiFi, Kindle 4 Touch
Folder and Book Hider

Kindles are awesome. A lot of people want to use mine, but sometimes I have various personal documents on it. I decided to make an option for people to have profiles, say for work and home, or for family members.

This is what I came up with:
A toggle that integrates with YiFanLu's GUI launcher. It creates a Menu called "Profiles", with four options. Hide and show profile1, and hide and show profile2.
There is a config file in the directory of each profile, in which you just need to add the names of the directories you wish to toggle

Read the README for more info, or take a look in the code. It's heavily commented.

---- POSSIBLE USE CASES ----
- Hiding books from kids
- Avoiding having to find your spot again in a book. If they can't see it, they can't mess it up
- Simplicity - only show a subset of your books at a time


---Instructions---
Download the FolderToggle.zip, and read the README.
Optional - if you are having problems, download the debugger and copy the contents into the hide.sh script, making sure to have a backup of the original. This creates a hide_profile_1_debug file with various diagnostic info.
Attached Files
File Type: zip FolderToggle v1.6.zip (5.9 KB, 324 views)
File Type: txt debugger_2.sh.txt (2.1 KB, 130 views)

Last edited by vaniaspeedy; 07-09-2012 at 06:47 PM. Reason: updated script
vaniaspeedy is offline   Reply With Quote
Old 01-08-2012, 08:11 AM   #2
lan54160
Junior Member
lan54160 began at the beginning.
 
Posts: 5
Karma: 14
Join Date: Jan 2012
Device: Kindle Touch
failed

Hi,
I try it on my Kindle Touch following the README.txt, and the "Profiles" is anded in the menu. But when I tap the sub-menu hide profile1 , there is no effect on it.

Only one line in the config file of profile1: Home Books, no quotes and no comma.

>>

Another question: tap on the sub-menu show profile1 will restart the Kindle Touch.

Last edited by lan54160; 01-08-2012 at 08:24 AM.
lan54160 is offline   Reply With Quote
Old 01-08-2012, 02:28 PM   #3
vaniaspeedy
Connoisseur
vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.
 
Posts: 51
Karma: 9502
Join Date: Oct 2010
Location: California
Device: Kindle 3 WiFi, Kindle 4 Touch
Quote:
Originally Posted by lan54160 View Post
Hi,
I try it on my Kindle Touch following the README.txt, and the "Profiles" is anded in the menu. But when I tap the sub-menu hide profile1 , there is no effect on it.

Only one line in the config file of profile1: Home Books, no quotes and no comma.
Is your folder you wish to hide called "Home Books"? As in, if you go to the documents folder, there is a folder "Home Books" there, correct?

Quote:
Another question: tap on the sub-menu show profile1 will restart the Kindle Touch.
This is the only way I know of at the moment to get the books to show up again. I haven't figured out a way to force a rescan of the documents folder, working on it at the moment.
---edit---
Thanks to rastik, the show script no longer triggers a reboot. Download the latest version, backup your config files, and extract the new version into the FolderToggle directory. Move the config files back, and voila!

Please let me know if this helps, we'll make it work!

Last edited by vaniaspeedy; 01-08-2012 at 02:51 PM.
vaniaspeedy is offline   Reply With Quote
Old 01-08-2012, 02:48 PM   #4
vaniaspeedy
Connoisseur
vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.
 
Posts: 51
Karma: 9502
Join Date: Oct 2010
Location: California
Device: Kindle 3 WiFi, Kindle 4 Touch
I have updated the hide script thanks to rastik, this newer version will show profiles without having to reboot.

Last edited by vaniaspeedy; 01-14-2012 at 11:39 PM.
vaniaspeedy is offline   Reply With Quote
Old 01-08-2012, 07:40 PM   #5
lan54160
Junior Member
lan54160 began at the beginning.
 
Posts: 5
Karma: 14
Join Date: Jan 2012
Device: Kindle Touch
Quote:
Originally Posted by vaniaspeedy View Post
Is your folder you wish to hide called "Home Books"? As in, if you go to the documents folder, there is a folder "Home Books" there, correct?
Yes. A folder with a file, named "Home Books".

I will try the latest version later, thanks.
lan54160 is offline   Reply With Quote
Old 02-11-2012, 10:46 AM   #6
diba
Addict
diba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolate
 
Posts: 395
Karma: 33660
Join Date: Jul 2011
Device: Kindle 3, Kindle 4, Kindle PW, Nexus7 3G
Does not show up in my Launcher, no clue why. Other extensions work properly, even modified ones.

UPDATE: Got it to show up, can modify the names, but does nothing.

Last edited by diba; 02-14-2012 at 01:41 AM.
diba is offline   Reply With Quote
Old 02-15-2012, 12:39 PM   #7
vaniaspeedy
Connoisseur
vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.
 
Posts: 51
Karma: 9502
Join Date: Oct 2010
Location: California
Device: Kindle 3 WiFi, Kindle 4 Touch
Quote:
Originally Posted by diba View Post
Does not show up in my Launcher, no clue why. Other extensions work properly, even modified ones.

UPDATE: Got it to show up, can modify the names, but does nothing.
By "modify the names", do you mean edit the config file?
Did you make a collection "Special", or an actual folder in the kindle filesystem called "Special"? Anything that's in Kindle:/documents/Special should be hidden
vaniaspeedy is offline   Reply With Quote
Old 02-15-2012, 01:36 PM   #8
diba
Addict
diba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolate
 
Posts: 395
Karma: 33660
Join Date: Jul 2011
Device: Kindle 3, Kindle 4, Kindle PW, Nexus7 3G
Yes, modified "Profiles" to "Profile", "hide profile1" to "Special verstecken" ...., could not find in the *.sh's any reason, why this should be a show stopper.
These changes are in the launcher and I can choose the options. But the book, even if in the Special folder in documents does not want to be hidden obviously.
diba is offline   Reply With Quote
Old 02-15-2012, 01:44 PM   #9
vaniaspeedy
Connoisseur
vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.
 
Posts: 51
Karma: 9502
Join Date: Oct 2010
Location: California
Device: Kindle 3 WiFi, Kindle 4 Touch
Hmm... let me tell you what I think is your situation, and you tell me if I understand it correctly.

1. you have a folder "FolderToggle" in the extensions folder, and inside are folders "profile1" and "profile2", with a config file and two sh scripts, show.sh and hide.sh. You have written "Special" (no quotes) in the first line of the config file in the folder "profile1"

2. You have a folder called Special in documents, with books inside that you want to show and hide

3. you have edited the menu.json to be in german, only changing the "name" values, without touching the action.

Is this correct?
vaniaspeedy is offline   Reply With Quote
Old 02-15-2012, 03:06 PM   #10
diba
Addict
diba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolate
 
Posts: 395
Karma: 33660
Join Date: Jul 2011
Device: Kindle 3, Kindle 4, Kindle PW, Nexus7 3G
thats right
diba is offline   Reply With Quote
Old 02-15-2012, 07:42 PM   #11
vaniaspeedy
Connoisseur
vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.
 
Posts: 51
Karma: 9502
Join Date: Oct 2010
Location: California
Device: Kindle 3 WiFi, Kindle 4 Touch
Quote:
Originally Posted by diba View Post
thats right
OK, I'm not quite sure what the problem is, so can you run this debugger script for me? Go to the folder profile1, make a backup of the file "hide.sh", and then create a new hide.sh with the following code:

Then post the "hide_profile_1_debug" file that is created (same level as documents)

Code:
#!/bin/bash
# debugger for my hide and show script.
# author VaniaSpeedy

#VARIABLES
config="/mnt/us/extensions/FolderToggle/profile1/config"

##----------
#pre-run
##1. does config exist, and is it readable?
#2. ls the start dir, double check that it is root
#3. check that the folders listed in config exist, and contain files (before they are moved)
#4. 

#during run

#after run


##----------
TODAY=$(date +"%y-%m-%d")
echo "Date: "$TODAY ", running debugger" >>  /mnt/us/hide_profile_1_debug

if [ ! -f $config ]
	then
	echo "Config file not found, exiting" >> /mnt/us/hide_profile_1_debug
	exit 0
fi

# moves folders to /mnt/us/.hidden
# input is read line by line from config file
hide() {
    if [ $1 = "." ] # redundant, but you never know
		then
        #echo "returning" 
        return

    elif [ ! -d $1 ] #folder doesn't exist, quit
		then
        echo "folder doesnt exist, exiting" >> /mnt/us/hide_profile_1_debug
        return

    else # all is well, continue
		origname=$1
		newname=`echo "../.hidden/"$1`
		mv $origname $newname
		echo "moved" $origname "to" $newname >> /mnt/us/hide_profile_1_debug
		
    fi
} #end hide()


# change dirs
echo "root listing:"
ls >> /mnt/us/hide_profile_1_debug

cd /mnt/us/documents
echo "documents listing:"
ls >> /mnt/us/hide_profile_1_debug

#mntroot rw # is this neccesary?

# if hidden dir doesnt exist, make it
if [ ! -d /mnt/us/.hidden ]
	then
	mkdir /mnt/us/.hidden
	echo "hidden dir made" >> /mnt/us/hide_profile_1_debug
fi


#IFS work
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")

while IFS= read -r file
do
	echo "calling for" $file >> /mnt/us/hide_profile_1_debug
	hide $file
done < $config

# restore IFS
IFS=$SAVEIFS

#mntroot ro


# refresh the home screen
#if flag empty, just refresh dbus. otherwise, reboot
if [ ! -f /mnt/us/extensions/FolderToggle/profile1/cycle ]
	then
	touch /mnt/us/extensions/FolderToggle/profile1/cycle # first cycle, make a flag	
	dbus-send --system /default com.lab126.powerd.resuming int32:1;exit # REFRESH
else # flag exists, delete it and reboot
	rm -f /mnt/us/extensions/FolderToggle/profile1/cycle
	shutdown -r now
fi
vaniaspeedy is offline   Reply With Quote
Old 02-22-2012, 03:33 PM   #12
Gianni
Member
Gianni began at the beginning.
 
Posts: 18
Karma: 14
Join Date: May 2011
Device: Kindle Touch jb
risk of data corruption?

Hi, I like very much this addon, and I will install it soon.
I'm not a linux expert, anyway it seems that the script hides books by moving them to an hidden folder. Is it safe to move files back and forward each time or is it asking for trouble?
I was wondering if this could be done more safely by:
- creating and erasing soft links to the book files (hidden)
- renaming files (modifying extension etc)
- changing attributes (no read) or chowning them

thanks
Gianni is offline   Reply With Quote
Old 02-23-2012, 06:13 PM   #13
Nyoxi
Connoisseur
Nyoxi can really shake a tail feather.Nyoxi can really shake a tail feather.Nyoxi can really shake a tail feather.Nyoxi can really shake a tail feather.Nyoxi can really shake a tail feather.Nyoxi can really shake a tail feather.Nyoxi can really shake a tail feather.Nyoxi can really shake a tail feather.Nyoxi can really shake a tail feather.Nyoxi can really shake a tail feather.Nyoxi can really shake a tail feather.
 
Posts: 55
Karma: 116549
Join Date: Jan 2012
Device: Kindle Touch
Quote:
Originally Posted by Gianni View Post
Hi, I like very much this addon, and I will install it soon.
I'm not a linux expert, anyway it seems that the script hides books by moving them to an hidden folder. Is it safe to move files back and forward each time or is it asking for trouble?
I was wondering if this could be done more safely by:
- creating and erasing soft links to the book files (hidden)
- renaming files (modifying extension etc)
- changing attributes (no read) or chowning them

thanks
I don't know if it's trouble or not. Unfortunately your suggestions are not applicable. The books are stored on FAT filesystem so you can't use links there. Neither can you change the permission because they're not supported by FAT. And as for modifying the extension ... I don't see how it's different from moving it into different directory.
Nyoxi is offline   Reply With Quote
Old 02-23-2012, 08:01 PM   #14
vaniaspeedy
Connoisseur
vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.vaniaspeedy knows what is on the back of the AURYN.
 
Posts: 51
Karma: 9502
Join Date: Oct 2010
Location: California
Device: Kindle 3 WiFi, Kindle 4 Touch
I decided to have them moved out beyond the scope of the documents folder because it seemed like the simplest way to do it. This way, if something goes wrong you can always move them back manually, or at least you have access to the books through USB.

If someone has access to the USB partition on your kindle, no matter how you hide the books they will still be accessible. I aimed this script at "in-the-field" deployment, for switching profiles on the go.

I'm open to suggestions for doing this more efficiently, as this process does take about a minute each time.
vaniaspeedy is offline   Reply With Quote
Old 03-02-2012, 12:34 PM   #15
ejonny
Junior Member
ejonny began at the beginning.
 
Posts: 3
Karma: 26
Join Date: Mar 2012
Device: Kindle Touch
Can't get it to work!

Argh, this looks useful but I can't get it to work on my KT for some reason. Here's where I'm at:

I have a folder "FolderToggle" in the extensions folder, and inside are folders "profile1" and "profile2", with a config file and two sh scripts, show.sh and hide.sh. I have "Home Folder" (no quotes) in the first line of the config file in the folder "profile1"

I have a folder called "Home Folder" in documents, with a book inside that I want to show and hide. I'm not familiar with the Kindle and what constitutes a "Book" but I've moved both the folder for a book and what seems to be an associated .azw file for that book into the "Home Folder" directory.

I have not edited the menu.json file at all.

The Launcher menu has been installed and does work with other hacks such as the orientation hack.

When I go to Launcher/Profiles/Hide Profile 1 Nothing happens. When I go to "Show Profile 1" the KT reboots.

I'm totally unfamiliar with the KT and it's file structure so it's probably something stupid I'm doing (or not doing!).
Any suggestions?
ejonny is offline   Reply With Quote
Reply

Tags
folder, gui, hiding, toggle, yifanlu

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kindle for Mac book folder location Mkoenig Amazon Kindle 11 05-05-2013 05:03 AM
PRS-350 Is Folder book organisation possible? SmartyPants Sony Reader 15 10-15-2010 02:28 AM
Folder and Book management wongdong Amazon Kindle 2 09-25-2010 01:51 PM
Is it possible to avoid the numbers between parenthesis in the folder name of a book? superplinio Calibre 5 11-08-2009 09:52 PM


All times are GMT -4. The time now is 08:32 AM.


MobileRead.com is a privately owned, operated and funded community.