01-06-2012, 08:39 PM | #1 |
Connoisseur
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. Last edited by vaniaspeedy; 07-09-2012 at 06:47 PM. Reason: updated script |
01-08-2012, 08:11 AM | #2 |
Junior Member
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. |
01-08-2012, 02:28 PM | #3 | ||
Connoisseur
Posts: 51
Karma: 9502
Join Date: Oct 2010
Location: California
Device: Kindle 3 WiFi, Kindle 4 Touch
|
Quote:
Quote:
---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. |
||
01-08-2012, 02:48 PM | #4 |
Connoisseur
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. |
01-08-2012, 07:40 PM | #5 |
Junior Member
Posts: 5
Karma: 14
Join Date: Jan 2012
Device: Kindle Touch
|
|
02-11-2012, 10:46 AM | #6 |
Addict
Posts: 396
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. |
02-15-2012, 12:39 PM | #7 | |
Connoisseur
Posts: 51
Karma: 9502
Join Date: Oct 2010
Location: California
Device: Kindle 3 WiFi, Kindle 4 Touch
|
Quote:
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 |
|
02-15-2012, 01:36 PM | #8 |
Addict
Posts: 396
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. |
02-15-2012, 01:44 PM | #9 |
Connoisseur
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? |
02-15-2012, 03:06 PM | #10 |
Addict
Posts: 396
Karma: 33660
Join Date: Jul 2011
Device: Kindle 3, Kindle 4, Kindle PW, Nexus7 3G
|
thats right
|
02-15-2012, 07:42 PM | #11 |
Connoisseur
Posts: 51
Karma: 9502
Join Date: Oct 2010
Location: California
Device: Kindle 3 WiFi, Kindle 4 Touch
|
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 |
02-22-2012, 03:33 PM | #12 |
Member
Posts: 22
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 |
02-23-2012, 06:13 PM | #13 | |
Connoisseur
Posts: 55
Karma: 124493
Join Date: Jan 2012
Device: Kindle Touch
|
Quote:
|
|
02-23-2012, 08:01 PM | #14 |
Connoisseur
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. |
03-02-2012, 12:34 PM | #15 |
Junior Member
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? |
Tags |
folder, gui, hiding, toggle, yifanlu |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Kindle for Mac book folder location | Mkoenig | Amazon Kindle | 12 | 01-04-2018 09:21 PM |
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 |