How to create a shelf icon that executes a shell programm call? - Chromebooks

Hey everyone,
I am looking for a way to activate sleep mode of my chromebook manually in order to save battery without having to log out or power off all the time (it's connected to an external display, so closing the lid doesn't trigger it).
So far I found out that calling "powerd_dbus_suspend" from the shell does the trick, but as you can imagine, using the shell and actually typing the command every time is not really a solution.
Is there a way to create a chrome os app that executes this program call, so I can put it in my shelf and just click it to activate sleep?
I'm not really good at .json, maybe there's a way? Or any other suggestions?
Thanks alot!
Markus

I would like to know it too. Anyone?

Sneets said:
Hey everyone,
I am looking for a way to activate sleep mode of my chromebook manually in order to save battery without having to log out or power off all the time (it's connected to an external display, so closing the lid doesn't trigger it).
So far I found out that calling "powerd_dbus_suspend" from the shell does the trick, but as you can imagine, using the shell and actually typing the command every time is not really a solution.
Is there a way to create a chrome os app that executes this program call, so I can put it in my shelf and just click it to activate sleep?
I'm not really good at .json, maybe there's a way? Or any other suggestions?
Thanks alot!
Markus
Click to expand...
Click to collapse
Run a tiny web server like lighttpd in the shell on a weird port, restrict to localhost. Set up index.php to run system (whatever);
Then bookmark the 127.0.0.1: xxxx URL

Which system call invokes power_dbus_suspend?
Thanks Parrotgeek1. Working off your excellent suggestion I installed a lightweight local server on ChromeOS (Web Server for Chrome with the 200 OK! icon) and built a small framework app that is served from local storage. I'm all set up to call chrome.app.??? from my JavaScript. Which API provides the power_dbus_suspend capability? I looked through the Power and System APIs and I don't see anything. - Thanks!

Sneets said:
Hey everyone,
I am looking for a way to activate sleep mode of my chromebook manually in order to save battery without having to log out or power off all the time (it's connected to an external display, so closing the lid doesn't trigger it).
So far I found out that calling "powerd_dbus_suspend" from the shell does the trick, but as you can imagine, using the shell and actually typing the command every time is not really a solution.
Is there a way to create a chrome os app that executes this program call, so I can put it in my shelf and just click it to activate sleep?
I'm not really good at .json, maybe there's a way? Or any other suggestions?
Thanks alot!
Markus
Click to expand...
Click to collapse
Have you tried this simple extension? Keep Awake
https://chrome.google.com/webstore/...lb?utm_source=chrome-app-launcher-info-dialog

What I do is have the shell tab pinned, and press [up arrow] for the command then hit [enter]. Probably not ideal if you use the shell a lot as you have to step through recently used commands.

Re: Pkt_Lnt's post
Thanks Pkt_Lnt. That app only deals with disabling the normal sleep behavior, not causing it, and in particular not causing it when an external monitor is connected. I'm looking for something like Sneets has requested, to invoke a powerd_dbus_suspend command that will force the system to sleep (and turn off an external monitor). Per Parrotgeek1's comment, I've got a little app now sitting on the shelf that is all set to call some system command to invoke powerd_dbus_suspend, only I'm looking for what command to call, from JavaScript.

I managed to find a way to do something similar with the Secure Shell app. During the process of figuring it out, I also found that I was able to create a homescreen shortcut on my Android tablet which when tapped sends a shell command to the Chromebook.
This method might be overkill somewhat, but, anyway, what I did was as follows:
Installed Secure Shell extension; setup sshd on the Chromebook (by making a symlink in /etc/init/ pointing to /usr/share/chromeos-ssh-config/init/openssh-server-conf); rebooted; added public key from ConnectBot (Android app) to ~/.ssh/authorized_keys in order to test connection; setup Android homescreen shortcut to send shell command; created profile in Secure Shell app on Chromebook to connect to [email protected]/my local IP address; generated keys on Chromebook (in ~/.ssh); added generated public key to ~/.ssh/authorized_keys; imported newly-generated private/public key pair within Secure Shell app (one by one); created bookmark link to [email protected] profile in shelf, and, finally, added required command to profile in Secure Shell.
It works well! It looks like any command can be added to the 'Arguments' field in Secure Shell, with the syntax:
Code:
-- thecommand
Although I guess commands that need sudo would require a connection to [email protected], instead of chronos. (-t argument lets you use sudo, but then sending a line break/ENTER seems to be needed)
The window opened with the click does hang around - I haven't figured out if it's possible to avoid this - but it does at least seem to persistently remember the size and position to which it's set.
I posted up some further details at http://nolirium.blogspot.com/shell-command-shelf-shortcut-chromeos.html

Impressive! But a bit more than I'm looking to do
@Nolirum - I read your blogspot doc and your procedure's pretty impressive. Frankly it's a little beyond me and beyond what I'm looking for. If you ever run across a way to invoke powerd_dbus_suspend a little more directly please post here as well. You clearly have a strong grasp of the issues!

Nolirum said:
I managed to find a way to do something similar with the Secure Shell app. During the process of figuring it out, I also found that I was able to create a homescreen shortcut on my Android tablet which when tapped sends a shell command to the Chromebook.
This method might be overkill somewhat, but, anyway, what I did was as follows:
Installed Secure Shell extension; setup sshd on the Chromebook (by making a symlink in /etc/init/ pointing to /usr/share/chromeos-ssh-config/init/openssh-server-conf); rebooted; added public key from ConnectBot (Android app) to ~/.ssh/authorized_keys in order to test connection; setup Android homescreen shortcut to send shell command; created profile in Secure Shell app on Chromebook to connect to [email protected]/my local IP address; generated keys on Chromebook (in ~/.ssh); added generated public key to ~/.ssh/authorized_keys; imported newly-generated private/public key pair within Secure Shell app (one by one); created bookmark link to [email protected] profile in shelf, and, finally, added required command to profile in Secure Shell.
It works well! It looks like any command can be added to the 'Arguments' field in Secure Shell, with the syntax:
Code:
-- thecommand
Although I guess commands that need sudo would require a connection to [email protected], instead of chronos. (-t argument lets you use sudo, but then sending a line break/ENTER seems to be needed)
The window opened with the click does hang around - I haven't figured out if it's possible to avoid this - but it does at least seem to persistently remember the size and position to which it's set.
Click to expand...
Click to collapse
This really is impressive! Thanks for the extremely detailed explanation.
I was able to follow along completely and get the SSH argument "powerd_dbus_suspend" working.
However, I got to thinking. I was wondering if this could be extended to use an alias stored in ~/.bashrc?
After doing some research of my own and using various parameters and arguments, I was unsuccessful.
The goal is to have a linux app (through crouton) be run using xiwi with just a single bookmark by utilizing an alias.
Any thoughts?
UPDATE:
Of course just a few moments later I figured this out! Rather than dealing with an alias stored in ~/.bashrc and ensuring ssh had access, typing the entire alias command as an argument worked. Now I can run Steam directly from a shelf bookmark. All it took was replacing "powerd_dbus_suspend" with "-- sudo enter-chroot xiwi steam" in the argument.
Thanks again!

DandyRandyMarsh said:
This really is impressive! Thanks for the extremely detailed explanation.
I was able to follow along completely and get the SSH argument "powerd_dbus_suspend" working.
Click to expand...
Click to collapse
No problem! I think it's perhaps overly detailed if anything. Might be easier to follow if I cut it down a bit.
DandyRandyMarsh said:
Now I can run Steam directly from a shelf bookmark. All it took was replacing "powerd_dbus_suspend" with "-- sudo enter-chroot xiwi steam" in the argument.
Click to expand...
Click to collapse
Nice!
Adding crouton single app shortcuts is a cool idea which I hadn't considered. Does it work OK for you with sudo in the command, even straight after booting up? ...You didn't have to setup sudoing without a password via sudoers.d or anything?
Inspired by your post I added xiwi to my chroot to try it out. I seem to remember experiencing quite unbearable lag and slowness when running a full desktop via xiwi in the past, but with single apps there doesn't seem to be any noticeable performance hit (this is on an armv7 Asus Flip, with the chroot on a slooow USB drive).
In order to not have to enter my sudo password, in the argument I put:
Code:
-t -- echo mypassword | sudo -S sh /media/removable/3/bin/enter-chroot xiwi firefox
Maybe I'm missing something? Is there a better way, perhaps?
Anyway, since I have rootfs verification switched off, I also tried saving a similar command to a file in /usr/bin, and putting the filename in the argument instead. This works, too, and I suppose could potentially be useful e.g. in the case of needing to run a more convoluted sequence of commands with a shortcut.

Nolirum said:
Adding crouton single app shortcuts is a cool idea which I hadn't considered. Does it work OK for you with sudo in the command, even straight after booting up? ...You didn't have to setup sudoing without a password via sudoers.d or anything?
Click to expand...
Click to collapse
I'm not entirely familiar with exactly how my process worked, but I do not have any sudo password required within shell.
Here's the list of steps I followed allowing me to use sudo commands in the SSH Arguments box.
As a side note, this is the crouton installation I am running on an ASUS c302.
sudo sh ~/Downloads/crouton -r trusty -t unity,touch,xiwi,extension
Setup Bookmarks that Run Shell Commands
1. Installed Secure Shell extension
2. Open crosh with Ctrl+Atl+T
3. Enter Command: shell
4. Enter Command: sudo su -
5. Enter Command: sudo /usr/share/vboot/bin/make_dev_ssd.sh --force --remove_rootfs_verification
6. Enter Command: reboot
7. Let Chrome OS reboot
8. Open crosh with Ctrl+Atl+T
9. Enter Command: shell
10. Enter Command: sudo su -
11. Enter Command: mount –o remount rw /
12. Close current crosh window
13. Open a new crosh with Ctrl+Atl+T
14. Enter Command: shell
15. Enter Command: sudo ln -s /usr/share/chromeos-ssh-config/init/openssh-server.conf /etc/init/openssh-server.conf
16. Enter Command: sudo initctl reload-configuration
17. Enter Command: sudo initctl start openssh-server
18. Enter Command: cd ~/.ssh/
19. Enter Command: ssh-keygen
“Enter file in which…” *LEAVE BLANK*
“Enter passphrase” *LEAVE BLANK*
“Enter same passphrase” * LEAVE BLANK*​20. Enter Command: cat /home/chronos/user/.ssh/id_rsa.pub >> /home/chronos/user/.ssh/authorized_keys
21. Enter Command: cp -a /home/chronos/user/.ssh/id_rsa* /home/chronos/user/Downloads
22. Close current crosh terminal and open Secure Shell extension
23. Select [New Connection]
24. Click Import… and select “id_rsa”
25. Click Import… again and select “id_rsa.pub”
26. Enter chronos as the username and localhost as the hostname
27. Enter a shorthand name replacing the text in the top cell “[email protected]”
28. Click Enter. If prompted, enter “yes” to continue connecting
29. Bookmark the page that is open which should end in, "#profile-id:_ _ _ _"
DONE. Now time to add some commands to automate.
Open Secure Shell and select the connection created. In the arguments box, start with two dashes -- and follow it your desired shell command.
Examples:
-- sudo startunity
-- sudo startgnome
-- sudo enter-chroot xiwi steam
-- sudo enter-chroot xiwi wine microWord​
Next Steps... Getting Custom Shelf Icons
Now here I am running into some issues. Rather than have all these icons be the same, I was hoping to customize them.
Followed a strategy found on reddit, Change Shelf Icon for Website, but this only works if the site already had an "apple-touch-icon" set. Also, tried to inject the entire code myself which I couldn't get to work. Unfortunately, I think that since this bookmark is created from a Secure Shell, there are some issues.
I have already tried adding in code for this into the site, but it is having no effect. If someone could make this work then we're really looking good here.

DandyRandyMarsh said:
I'm not entirely familiar with exactly how my process worked, but I do not have any sudo password required within shell.
Click to expand...
Click to collapse
Oh, I see what you mean. You are saying that you can sudo in the shell generally, without being prompted for a password, right?
Was that the default setup on your CB (after switching to Dev mode)? Or did you have to configure it manually for passwordless sudoing...
DandyRandyMarsh said:
Here's the list of steps I followed allowing me to use sudo commands in the SSH Arguments box.
Click to expand...
Click to collapse
Nice work summarizing the steps. :highfive: It's probably easier to follow, listed out like that. One slight addendum, perhaps - at step 29, it might be good to clarify the "add to shelf" procedure. Especially because of the following...
DandyRandyMarsh said:
Next Steps... Getting Custom Shelf Icon
Now here I am running into some issues. Rather than have all these icons be the same, I was hoping to customize them.
Click to expand...
Click to collapse
Happily it turns out that, when you add shortcuts to the shelf on Chrome OS like this, a minimal app is created for each one, with its own manifest.json, and icon.pngs. Our shell shortcuts were getting created with blank pngs by default (the black box with P in the center).
So, all we need to do, is get some icons, find the right folder for our shelf shortcut apps, then copy our new icons into them!
For instance, here's how I made a nice shiny icon for my single app shelf shortcut to Firefox.
Prepared icons:
Created a temporary folder in ~/Downloads to store downloaded icons.
Prepared a set of icons in ~/Downloads/firefox. (I downloaded mine from findicons.com).
Six sizes are required - from 32px to 256. To avoid any manifest editing, saved them as *size*.png
e.g. 32.png; 48.png; 64.png; 96.png; 128.png; 256.png
Located folder to copy icons to:
It is easiest to do this directly after clicking "add to shelf"
EITHER:
To change dir into the most recently modified extension icon subfolder automatically, the following one-liner worked for me*.
Code:
shell
cd ~/Extensions/&&cd $(ls -v1td */ | head -1)/*/icons&&ls
A list of blank icons (*.png) should be visible. If so, the new icons can simply be copied over these, e.g..
Code:
sudo cp ~/Downloads/firefox/* .
*YMMV with this particular one-liner - sometimes there's an extra 'temp' folder in ~/Extensions, which stops it working as expected. If you get an error after running the command, simply use the slightly more manual method to locate the folder, as detailed below.
OR:
(slightly more manual method).
Code:
shell
ls -ltr ~/Extensions
Checked the date/times - the most recently added folder is at the bottom. Then,
Code:
cd themostrecentlyaddedfolder
(or, the folder modified at the date/time that the shortcut was "added to shelf"). Then,
Code:
cd */icons
ls
sudo cp ~/Downloads/firefox/* .
I then repeated the above with a new SSH argument and a set of Ubuntu icons, for a custom startxfce4 shortcut, too.
Then just did sudo restart ui, and enjoyed the shiny new shelf icons!
I am hopeful that these changes will get picked up by CrOS's sync, thus getting backed-up and restored automatically. At this point I am not sure if that will be the case, but I don't see why it wouldn't.

Another way?
Another way to approach this, since you're modifying system stuff anyway, might be to edit crosh at /usr/bin/crosh. It's a regular ol' dash/bash shell program, and you can create a shortcut to it on the shelf by opening crosh (ctrl-alt-T), then right click the top right of the browser and select More Tools --> Add to shelf...
Clicking the newly-created link (which looks like an "N") will launch /usr/bin/crosh in a tab. Changing the default behavior of /usr/bin/crosh could accomplish your goal to do whatever you want. With some experimenting, you might even be able to pass arguments to make it do different things depending on how it's opened (via ALT-CTRL-T vs from the shelf-- dunno if it can read the url used to call crosh), but at the very least you could do something like have it run whatever you want it to run if a second modifier key is held down (or if it isn't...), otherwise return to normal operation. A menu w/1 sec timeout could do this as well, ie--
Doing [THE THING YOU WANT] in 2 seconds (press SPACE for crosh)... /
Note there's no proof-of-concept here. Just throwing it out as an idea that I'm pretty sure would work... Someone might even create a neat extension that allows crosh to use scripts/plugins to execute different system operations beyond the stock ones that are built-in via single-clicks... If it worked, it might be a little simplier than via the SSH extension and you wouldn't have to run any extra daemons.
ft
This is probably harder, but a third way, which probably is the "right" way is to see how the crosh extension works and learn about opening the hterm.Terminal instance chrome.terminalprivate object directly, sending it output, and closing it in the same way crosh does it. There's a file in the crosh extension at js/crosh.js that shows the basics of how it's done:
var terminal = new hterm.Terminal(profileName);
And then you can do stuff with it. You could then create an extension that could handle multiple shelf-icons (say by appending ?COMMAND=ls to the URL to do different shell commands(. The security implications for this would probably be huge obviously.
Update: More on embedding hterm is here.
Nolirum said:
I managed to find a way to do something similar with the Secure Shell app. During the process of figuring it out, I also found that I was able to create a homescreen shortcut on my Android tablet which when tapped sends a shell command to the Chromebook.
I posted up some further details at http://nolirium.blogspot.com/shell-command-shelf-shortcut-chromeos.html
Click to expand...
Click to collapse

Nice post - Some good food for thought, changing up the contents of crosh etc directly is an interesting idea.
fattire said:
Another way to approach this, since you're modifying system stuff anyway, might be to edit crosh at /usr/bin/crosh. It's a regular ol' dash/bash shell program, and you can create a shortcut to it on the shelf by opening crosh (ctrl-alt-T), then right click the top right of the browser and select More Tools --> Add to shelf...
Click to expand...
Click to collapse
Interesting! ....Aaaaand, now I've broken crosh. lol. Lucky I had my SSH shortcut setup... (actually, we can still get into the VTs with CtrlAltF2 etc anyway).
Some good potential for experimentation with this, definitely.
fattire said:
This is probably harder, but a third way, which probably is the "right" way is to see how the crosh extension works and learn about opening the hterm.Terminal instance chrome.terminalprivate object directly, sending it output, and closing it in the same way crosh does it. There's a file in the crosh extension at js/crosh.js that shows the basics of how it's done:
Click to expand...
Click to collapse
Again, very interesting. Now you come to mention it, an approach such as this does seem like it might be do-able without too much messing around (maybe)...
Any possible method we can get e.g. an extension to 'talk' to the shell is worth looking into I think; as you say, if we can cut out the middleman (ssh) and maybe do it more elegantly, that might be pretty useful indeed.

Related

[TUTORIAL] Run Ubuntu 10.10 on Nexus One

Run Ubuntu 10.10 on Nexus One
--------------------------------
Background:
In June 2010, XDA zedomax got Ubuntu 9.04 running on Nexus One, tutorial is available at this thread:
http://forum.xda-developers.com/showthread.php?t=718952
I continued studying the tutorial and worked out a way to make Ubuntu 9.04 running better, smoother and cause less error, here's my post:
http://forum.xda-developers.com/showthread.php?t=815532
Recently HTC_Linux team has released version 0.3 of their Ubuntu image, compare to the original guide provided by zedomax, the v0.3 release is based on the latest Ubuntu 10.10. So I thought about making this tutorial to guide you to run Ubuntu 10.10 on your Nexus One.
--------------------------------
What benefits will you get from running Ubuntu 10.10 on Nexus One (at least):
1. Fully functional Linux terminal, with all standard Linux command line utilities
2. Fully functional desktop browser Firefox 3.6.13
3. Ability to compile and run native Linux applications
4. Bunch of graphical Internet and utility applications as shown in the screenshots
--------------------------------
Credit:
Thanks to the great XDA-developers community.
Thanks to Zedomax for providing the original tutorial of running Ubuntu on Nexus One.
Thanks to HTC_Linux team for creating the optimised Ubuntu 10.10 image file.
--------------------------------
Now the tutorial starts.
Preparation:
1. A micro SD card at least 4GB in capacity, 8GB/16GB is recommended
2. (Optional) If you're using Froyo App2SD, move all your applications which are on SD card back to Internal Storage, or you may also uninstall all applications that are on SD card. If you fail to do so, you won't be able to enter Ubuntu. However I've discovered a way that you won't need to move or uninstall apps on SD card, will discuss later.
3. Basic Linux shell knowledge
Then:
1. Get Ubuntu 10.10 from this post (file name: hd2-ubuntu_0.3.zip): http://forum.xda-developers.com/showthread.php?t=889433
2. Download attached scripts.zip
3. On your computer, make a directory on a partition that has more than 3.5GB available space, name the directory “ubuntu” (case-sensitive!)
4. Extract three scripts (b, e, u) from scripts.zip to the directory ubuntu
5. Once you finish download hd2-ubuntu_0.3.zip, extract linux/rootfs.ext2 to the directory ubuntu
6. In your ubuntu directory, rename rootfs.ext2 into ubuntu.img (case-sensitive!)
7. Now verify that you have the following files in your computer's ubuntu directory: b, e, u, ubuntu.img
8. Copy the whole ubuntu directory onto your SD card, put the SD card back to your phone
9. Power up your Nexus One
Now we have some script work:
1. Run a terminal application from your phone (e.g. Android Terminal, Better Terminal Emulator)
2. type “cd /sdcard/ubuntu” (enter)
3. type “sh u” (enter)
4. If you see “Type 'b' to boot Ubuntu”, then you're almost there!
5. Type “b” (enter)
6. If you see “[email protected]:/#” (like shown in screenshot) Congratulations! Now you're running Ubuntu 10.10 on your Nexus One!
Whenever you want to enter Ubuntu again, simply type “b” (enter) in your Android Terminal.
To properly exit from Ubuntu, you must type “exit” from Ubuntu terminal.
If your Android terminal application gets killed by Android system (i.e. you lost Ubuntu terminal), you need to go back to Android terminal, type “e” (enter), that will properly unmount Ubuntu.
Very often that you can get “loop device busy” error when exiting from Ubuntu, in that case, type “e” (enter) multiple times (it's harmless to run “e” script multiple times, don't worry). If still you get “loop device busy” error, don't worry, ignore it then.
--------------------------------
(Optional) If you would prefer working with GUI, now let's do some extra script work:
1. Install “android-vnc-viewer” from Market (freeware)
2. Enter Ubuntu terminal
3. Make sure that you have network connection (Wi-fi recommended)
4. type “apt-get update” (enter), and wait till it finishes
5. type “apt-get install tightvncserver” (enter) and answer “y” to the question
6. After installed tightvncserver, type “cd /bin” (enter)
7. Type the following commands (all are case-sensitive!):
“cat > x” (enter)
“rm -r -f /tmp” (enter)
“mkdir /tmp” (enter)
“chmod 777 /tmp” (enter)
“export USER=root” (enter)
“export XKL_XMODMAP_DISABLE=1” (enter)
“vncserver -geometry 1024x800” (enter)
(enter)
(press and hold trackball and click D on keyboard)
“chmod 777 x” (enter)
8. The above procedure makes a script named “x”, whenever you want to start GUI, you need to type “x” (enter).
Notice that the first time (only the first time) you run “x” script you'll be prompt to enter a password for VNC connection, then you'll be asked whether to create a “view-only” password, since it is not necessary, answer “n” to the question.
9. Start “android-vnc-viewer”, create a new connection with the following settings:
Nickname: (anything you like to identify the connection)
Password: the VNC connection password that you created when ran the “x”script
Address: localhost
Port: 5901
Color format: 24-bit color (4 bpp)
Click “Connect” button, and in about a minute, you'll see your Ubuntu 10.10 desktop!
10. We still need to create one final script called “s”, now go back to your Ubuntu terminal and type:
“cd /bin” (enter)
“cat > s” (enter)
“export USER=root” (enter)
“vncserver -kill :1” (enter)
“vncserver -kill :2” (enter)
“sudo reboot” (enter)
“sudo halt” (enter)
(enter)
(press and hold trackball and click “D” on keyboard)
“chmod 777 s” (enter)
11. If you have GUI running, you * MUST * type “s” (enter) to stop VNC server before you exit from Ubuntu terminal!
In case that your Android kills your Android Terminal application and you still have VNC server running, do the following steps:
a. Start Android Terminal
b. type “b” (enter) to bring back Ubuntu terminal
c. type “s” (enter) to stop VNC server
d. type “exit” (enter) to exit from Ubuntu terminal
Fail to do so you will have problem with VNC connection next time you use it.
--------------------------------
What are not working in Ubuntu:
1. Sound
2. Some applications may not run (I guess, due to Android memory management mechanism)
--------------------------------
A little trick to access SD card from your Ubuntu:
1. Install “SwiFTP” from Market (freeware)
2. Set up FTP server using SwiFTP
3. In Ubuntu, “Places → Connect to Server” then:
Service type: FTP (with login)
Server: localhost
Port: (port number specified in SwiFTP, default is 2121)
Folder: /
User Name: (user name specified in SwiFTP)
Then press “Connect” and enter your password specified in SwiFTP. Now feel free to access your phone's file system!
--------------------------------
How to bring up Ubuntu if you have applications installed on SD card using Froyo App2SD:
1. Make sure that your Android Terminal application is installed in Internal Storage
2. Put a shortcut to Android Terminal application on your home screen
3. Make sure you have got ubuntu directory and all its contents on SD card
4. Reboot your phone (stay sharp, these following steps require perfect timing!)
5. Once you enter lock screen, Immediately unlock it.
6. Enter Android Terminal and type “b” as quick as possible, do not press Enter yet!
7. Pay close attention to your notification bar, as soon as the “SD: Checking for errors” notification disappears (the little SD icon disappears), Immediately press Enter.
8. Now you should be in Ubuntu terminal, wait 1-2 minutes before you do anything else.
9. After 1-2 minutes, you may do whatever you want.
With some applications installed on SD card, you must do the procedure above to bring up Ubuntu terminal each time you reboot your phone.
--------------------------------
That's it! Thank you for reading this tutorial. Please feel free to make any comment or ask any question!
Awesome. I'll be trying this out as soon as I get a larger SD card. It would be great if you could upload a .zip with all of the scripts, downloads, etc. already placed in one folder; that would make it a lot easier.
Thx U for this Tutorial....it was really helpful...Can u fix the adobe flash thing...i know that sound will not work but just wondering if it can be installed.
yumcax said:
Awesome. I'll be trying this out as soon as I get a larger SD card. It would be great if you could upload a .zip with all of the scripts, downloads, etc. already placed in one folder; that would make it a lot easier.
Click to expand...
Click to collapse
Actually I thought about the same but here my uploading speed is 15kb/s maximum, so I'm not sure if I'm gonna upload a 600mb file...
reubenjack said:
Thx U for this Tutorial....it was really helpful...Can u fix the adobe flash thing...i know that sound will not work but just wondering if it can be installed.
Click to expand...
Click to collapse
Adobe Flash has no support for ARM architecture.. sorry, there's no way to install Adobe Flash plugin for Firefox on Ubuntu ARM.
OMG Im abt to die. Transfering the folder to my sd card takes 20 min. I really nid to get a better memory card (higher speed). SIGH..
Works nice on my N1 running MIUI 12.24..
BTW I have a question, if I wipe my phone(data,cache).. Would I need to perform any steps then?
Keshav_CoolDude said:
Works nice on my N1 running MIUI 12.24..
BTW I have a question, if I wipe my phone(data,cache).. Would I need to perform any steps then?
Click to expand...
Click to collapse
If you re-installed a rom (i.e. /system partition gets rewritten)
You'll need to execute the following commands on Android Terminal:
cd /sdcard/ubuntu
sh u
then type "b" to enter Ubuntu terminal
Happy New Year!
Hey,
In the OP you mention that some apps will not run because of the memory management? Is there a size threshold that this is start to be seen at or is it totally random on which things run/don't?
Thanks
houzuoguo said:
If you re-installed a rom (i.e. /system partition gets rewritten)
You'll need to execute the following commands on Android Terminal:
cd /sdcard/ubuntu
sh u
then type "b" to enter Ubuntu terminal
Happy New Year!
Click to expand...
Click to collapse
Okay.. Thanks for the guide..
Happy New Year..
Chopes said:
Hey,
In the OP you mention that some apps will not run because of the memory management? Is there a size threshold that this is start to be seen at or is it totally random on which things run/don't?
Thanks
Click to expand...
Click to collapse
I'm not very familiar with Linux kernel so sorry I can't give an accurate explanation
According to my observation, many applications in the Ubuntu 10.10 can successfully start (program title appears in task bar) but immediately they turn off by themselves.
And it seems to me that all those applications share a same characteristic: they're relatively bigger than others. For example, Terminal runs, Dictionary runs, Firefox runs, but Ubuntu Software Centre won't run.
So my guess is ... Android system would not allocate too much memory for an application in Ubuntu, thus they get killed before they could start.
I'll give this a one thumb up, because I got it working, got to play around a bit... it looks really nice... but I did a reboot of my phone after shutting it down properly, and now everytime I try to launch ubuntu again, I get a bunch of errors.
I've tried just about everything.... restoring to my nand backup I did before trying this, deleting the files off the sdcard and on my system relating to this, tried to set everything back up... but I still get errors and I can't get past them, even with trying "e" in the term.
FWIW, I'm on CM 6.1.1 and I do use DTa2sd with plenty of space left on all partitions. Here's a pastebin of my errors : http://pastebin.com/adCQ62iF
tehgeekguy said:
I'll give this a one thumb up, because I got it working, got to play around a bit... it looks really nice... but I did a reboot of my phone after shutting it down properly, and now everytime I try to launch ubuntu again, I get a bunch of errors.
I've tried just about everything.... restoring to my nand backup I did before trying this, deleting the files off the sdcard and on my system relating to this, tried to set everything back up... but I still get errors and I can't get past them, even with trying "e" in the term.
FWIW, I'm on CM 6.1.1 and I do use DTa2sd with plenty of space left on all partitions. Here's a pastebin of my errors : http://pastebin.com/adCQ62iF
Click to expand...
Click to collapse
Happy New Year!
Could you please go to Settings-> Application Settings-> Manage Applications-> on SD card and confirm there is no application on SD card?
Also please make sure you execute "b" after "Checking for Errors" notification disappears.
Running this distro does that mean i can use firesheep on my n1?
Awesome! What kind of battery life are you seeing using Ubuntu? Any apps in particular you've enjoyed having on your N1?
rossonza said:
Running this distro does that mean i can use firesheep on my n1?
Click to expand...
Click to collapse
According to my study Firesheep would require WinPcap to work, WinPcap is only available for Windows so unfortunately you can't use it.
Deathwish238 said:
Awesome! What kind of battery life are you seeing using Ubuntu? Any apps in particular you've enjoyed having on your N1?
Click to expand...
Click to collapse
I notice battery drains 2-3 mAh more when Ubuntu is idle, when actually using Ubuntu I notice 30-40mAh higher current draw. So actually it's not much
hey thanx houzuoguo,
working great on my n1....!!
is there any solution for the sound to run...??
I cant seem to get any of the "cat >" letters to work, it just hangs in the terminal.
houzuoguo said:
According to my study Firesheep would require WinPcap to work, WinPcap is only available for Windows so unfortunately you can't use it.
I notice battery drains 2-3 mAh more when Ubuntu is idle, when actually using Ubuntu I notice 30-40mAh higher current draw. So actually it's not much
Click to expand...
Click to collapse
Firesheep works in Ubuntu, you just have to compile it yourself.
1) Download the required dependencies:
Code:
sudo apt-get install autoconf libtool libpcap-dev libboost-all-dev libhal-dev xulrunner-1.9.2-dev
2) Install git:
Code:
sudo apt-get install git
3) Download the Firesheep source:
Code:
git clone https://github.com/codebutler/firesheep.git
4) Change to the Firesheep directory:
Code:
cd firesheep
5) Initialize it:
Code:
git submodule update --init
6) Compile it:
Code:
./autogen.sh && make
7) You'll find the file in the build directory.
hotweiss said:
Firesheep works in Ubuntu, you just have to compile it yourself.
1) Download the required dependencies:
Code:
sudo apt-get install autoconf libtool libpcap-dev libboost-all-dev libhal-dev xulrunner-1.9.2-dev
2) Install git:
Code:
sudo apt-get install git
3) Download the Firesheep source:
Code:
git clone https://github.com/codebutler/firesheep.git
4) Change to the Firesheep directory:
Code:
cd firesheep
5) Initialize it:
Code:
git submodule update --init
6) Compile it:
Code:
./autogen.sh && make
7) You'll find the file in the build directory.
Click to expand...
Click to collapse
Not to threadjack or anything of the sort but:
Does the above method work on getting firesheep installed on a n1 running ubuntu or is this just the way to install it assuming your running on normal hardware?
Second question, what is the resulting file?
Thanks,
Which terminal application are you using, and did you type the "cat >" on screen keyboard or copy&paste?

[APP] CommandCenter the power of shell without having to use the termina

Have you ever dreamed of an app to execute your favorite shell commands, whether it is for collection dmesg/logcat/dumpsys or set kernel parameters.
Well here comes CommandCenter, a generic app for grouping all your favorite commands.
CommandCenter is free with ads and can be downloaded from the Android Markethttps://market.android.com/search?q=com.asksven.commandcenter(IT TAKES SOME TIME TO UPDATE CUZ ITS JUST PUBLISHED
It is also open source
If you are a kernel developer you may want to provide a tool for your users to run certain commands without havint to maintain an app for that; if yes just submit a Command Set and have your users download it.
If you are a poweruser there are commands that you use all the time, wither from adb shell or in the terminal. Make one or multiple Command Set and enjoy the comfort of an Android app and the power of your favorite commands.
http://market.android.com/publish/i...0_ndAPFoAzfqVabGrGq2vHV4L2LRT4mKNjfMwlEo5.png
How it works
The command sets are stored of the sdcard in the app's private folder /sdcard/Android/data/com.asksven.commandcenter/files in the form of json files. On load the files are parsed and each file (Command Set) shown as a tab.
A single click on a Command displays its details, a long click pops up a dialog from where you can run the command (this is configurable in the preferences).
A command has two parts:
- the command to be executed itself: it may contain a variable and in that case a popup will ask for the value to be used
- an optional command to retrieve a status: if a status can be read it will be displayed
CommandCenter comes with two pre-configured Command Sets:
- general commands for logging / diagnosis
- a few command for Fracisco Franco's awsome GN kernel
Caution
Always check the command's before running them. CommandCenter support 'su' command and you should know what you do as those could harm your phone. I will not take any responsibility for any dammage caused by command run using CommandCenter
RELEASE NOTES:
v0.7.2 2012-02-12
#2: dumpsys missing su, and logcat files have zero-length
#3: A few issues with backward compat to Android 2.1/2.2 fixed
v0.7.1 2012-02-11
#1: fixed Android 2.1 compatibility issue
v0.7 2012-02-11 Initial release
ALL CREDITS TO chamonix FOR THE GIFT
Wrong section bro..!
Themes and Apps!
Sent from my iPad 3 using XDA App
does it even matter if it solves the purpose??
it is not about what matters and what not!it is all about being sorted and arranged.
I think this thread should be deleted, it's not even related to the phone!
Greets!

[Updated: JUN 15] Easier XMir Setup (Now with Libertine!)

EDIT: I bring you the new OFFICIAL way of installing X11 applications, I've been neglecting this thread way too much and need to give it some love.
The old instructions (OLD METHOD) are no longer needed as of April on the rc and rc-proposed channels, this should work on all channels however (tested up to latest devel-proposed image)
NOTE: You still need a writable image for the first parts of this, after you install the tools, it can go back to read-only.
1) Open Terminal
2) Install the following packages: libertine libertine-tools python3-libertine-chroot
3) Open the Ubuntu Store and install the scope: libertine-scope
4) Open the Libertine application that's now available in your launcher and follow instructions, it will set up a Ubuntu Vivid chroot in your home directory, install the components needed, and drop you at the package management screen. From here, you can update and add PPAs to the container via the Settings Icon -> Manage Container, Install packages via the plus icon, etc.
5) Favorite the Libertine XApps scope by swiping up on the home screen and hitting the star, then open the scope and you'll see any applications you installed there.
If you cannot install your container via the Libertine application (I know that it didn't have support for chroot until recently, not sure if that version has landed yet), you can install your container via the teminal, so open your terminal but DO NOT sudo su. All Libertine-container-manager commands MUST be done as phablet.
To create a container (this line will likely change when Xenial drops as Libertine will be switching to LXC on Xenial):
Code:
libertine-container-manager --create -i <container id> -n <friendly name (this shows up in the Libertine app)> -t chroot
Using this command, the system will build the new libertine container, wait until it's finished and then you can continue by using the installed Libertine application.
Onscreen Keyboard in Libertine Applications
THIS CAN FINALLY BE DONE! The only con to it, is that it is mostly unusable in applications that open dialog boxes along the bottom of the screen, the XMir window does not scroll up like native applications do to give a better viewing window. (I have been told that this will change in OTA-12 when the keyboard support drops for Libertine/Puritine apps)
To install on-screen keyboard:
Open Libertine and add ppa:brandontschaefer/maliit to your container. Then hit update in Manage Containers. Once done, install the following, maliit-inputcontext-gtk2, maliit-inputcontext-gtk3, maliit-framework. After that, setup is complete in your container, now we need to do some extra work outside the container to make it pass the GTK_IM_MODULE variable we need over to Libertine. To do this, add this line to your .bashrc or if you have a writable image, you can add this to the systemwide profile (not sure if this will be replaced on OTA though):
Code:
export GTK_IM_MODULE=maliitphablet
Restart the tablet OS, Open an application such as Libreoffice Writer and BEHOLD!
Notes
You can also manage your container via the terminal with libertine-container-manager. To get a root shell without installing mate terminal (You can't get a root shell via this method (installing a term), Proot acts like fakeroot all over your container's rootfs), you can use the following:
- l-c-m exec -c bash (This command does not mount any user directories (/home/phablet will not exist) and is best used for making changes to the container's rootfs)
or if you only need a user shell:
- DISPLAY= libertine-launch <containerid (default is vivid)> bash (This mounts user directories, but is no different than if you installed something like mate-terminal and ran it. The reason we are passing an empty DISPLAY variable is because libertine-launch will refuse to start if DISPLAY isn't set, even it if doesn't exist.)
- DPI Hacks: To change the DPI of applications in Libertine, you need a new way to make the .Xdefaults file as only the XDG User directories get mounted inside the libertine container, not your entire Home. To do this, install your favorite editor inside of the libertine container (I find nano to be the easiest for new users), and open Terminal, then follow these instructions:
1) Open your editor to ~/.local/share/libertine-container/user-data/[my container id, default = vivid]/.Xdefaults and fill it with the following:
Code:
Xft.dpi: 175
or what your preferred DPI is. On the Nexus 7 flo the comfortable DPI is 175 with an application font size of 14 (I use Liberation Sans which comes from Libreoffice).
- You can make your applications look great still, you don't have to be stuck with the default Raleigh GTK style. Download and install LXAppearance in your container and add ppa:noobslab/themes then start installing themes. Enjoy! The Ubuntu Touch Themes are wonderful and FlatPlat works well with the system UI as well.
Some cons to this:
- It requires at least 3GBs available in your internal storage (wherever your home folder resides) to store a full, non-touch Ubuntu Vivid container.
Pros:
- It survives OTAs, the only thing able to break this would be a change to XMir, PRoot, or Libertine. Which is landing in the images shortly by default so there's not much of a chance to break this.
- Nothing you do will break your UTouch system. Unlike the old method, this only installs the items needed to run the container, which are to become standard inside the images very soon.
OLD METHOD
--------------------
EDIT: I have not tested this in stable, rc, rc-proposed yet. Only the dev-proposed channel.
So there is some questioning I see going on about how to run things like Firefox efficiently and well. So I figured I'd write up a little something for it.
First you'll want to set your DPI in ~/.Xdefaults, as I have a Nexus 7, mine looks similar to this:
Xft.dpi: 240
Note that you may need to do some additional tweaking.
Now that you have Xdefaults made, install the ubuntu-pocket-desktop and matchbox-window-manager packages (along with the program you wish to use, for this tutorial, I'll use libreoffice).
Create a file in /bin called wm-wrapper.sh (or whatever you choose here, just remember the name), fill it with:
Code:
#!/bin/bash
matchbox-window-manager -use_titlebar no -use_dialog_mode const-horiz &
exec [email protected]
and save it, then chmod a+x it.
EDIT: For this next part, I recommend copying the .desktop to ~/.local/share/applications to avoid them being overwritten on package updates.
Now, navigate to /usr/share/applications/ and open the .desktop file for the application you are wanting to run. Add the following lines under [Desktop]:
Code:
X-Ubuntu-Touch=true
X-Ubuntu-XMir-Enable=true
Change the Exec line so that your wrapper (in my case wm-wrapper.sh) is in front of the executable, such that the line becomes (or similar):
Code:
Exec=/bin/wm-wrapper.sh libreoffice %U
Save it, then search for your application in the Unity Scopes. Open it up and you should see your application running as an XMir app easy. For future applications, you will simply need to do the changes to it's .desktop file.
EDIT: A helpful redditor gave me this tip to enable sending touch events over to Xmir. Setting the GTK_TEST_TOUCHSCREEN environment variable to 1 will apparently remove hover events and the like (events that are not normally sent with a touch screen, but with a mouse). I have not had time to take a look at this yet however so YMMV.
Thanks man, gonna try this on my n4 later today. ?
thumbzzzz said:
Thanks man, gonna try this on my n4 later today.
Click to expand...
Click to collapse
No problem, Like I said, not sure if it works on other channels, but it works great on the dev-proposed channel. You will also want to close applications using their menu items as closing the Xmir root window will cause the application to terminate without asking to save anything. Libreoffice can get around this via Document Recovery though.
I had been working on this for a good solid week testing applications and different ways to get X11 applications working so I could make it a full workstation, so I figured why not post my findings since the Ubuntu forum doesn't seem to get much love.
Thanks for the matchbox tip! It works quite nicely, especially, it brings a nice onscreen keyboard with it. I use the following setup now:
~/.local/share/applications/gedit-mb.desktop
Code:
[Desktop Entry]
Name=GEdit in Matchbox
Type=Application
Terminal=false
Icon=/usr/share/gedit/logo/gedit-logo.png
X-Ubuntu-Touch=true
#X-Ubuntu-XMir-Enable=true
Exec=/home/phablet/bin/matchbox-wrapper.sh gedit
~/bin/matchbox-wrapper.sh
Code:
#!/bin/bash
export DISPLAY=:1
Xmir $DISPLAY &
sleep 1
# xlogo
# xeyes
# x11vnc -forever -nopw -quiet -display $DISPLAY &
matchbox-window-manager &
sleep 1
matchbox-keyboard &
[email protected]
~/.matchbox/kbdconfig
Code:
# http://unix.stackexchange.com/questions/223110/what-are-the-keyboard-shortcuts-for-matchbox-window-manager
<ctrl><alt>p=prev
<ctrl><alt>n=next
<ctrl><alt>d=!matchbox-desktop
<ctrl><alt>x=!xterm
<ctrl><alt>f=!firefox
Together with the Xft.dpi setting (I use 220) this gives me a quite usable editor. If you have any other tips ShadowEO, I'd love to hear them!
One thing I'd like to figure out is how to modify the DPI for the Mir GDK Backend. Currently GTK3 applications started with the backend are way to small.
ShadowEO said:
One thing I'd like to figure out is how to modify the DPI for the Mir GDK Backend. Currently GTK3 applications started with the backend are way to small.
Click to expand...
Click to collapse
Do you have a specific example? Which application are you looking at?
doniks said:
Do you have a specific example? Which application are you looking at?
Click to expand...
Click to collapse
Sorry, for some reason I wasn't subscribed to this post (weird.)
Anyway the specific application I was looking at was gedit, when started with the native GDK Mir backend, it is almost unusable with touch as the elements are so small. GDK_SCALE doesn't work and neither does any of the GTK dconf settings for scaling.
Also, I have switched to using rc-proposed, so any more changes I do will likely be able to be installed without worrying about the snapshot channel.
Also messing with some touch-screen specific .gtk2.0-rc entries seem to help, but since I reformatted, I don't quite have those offhand at the moment. I'll have to look them up again.
Hi!
Thanks a lot for all these useful explanations! Finally I was able to run Firefox on my bq E4.5 (rc-proposed)! But I have a few questions:
1) I don't have any on-screen keyboard
2) it works like with a mouse (no touch scrolling for instance)
Is there something I can do about that?
takri said:
Hi!
Thanks a lot for all these useful explanations! Finally I was able to run Firefox on my bq E4.5 (rc-proposed)! But I have a few questions:
1) I don't have any on-screen keyboard
2) it works like with a mouse (no touch scrolling for instance)
Is there something I can do about that?
Click to expand...
Click to collapse
You could try the touchegg package for multi touch gestures, I haven't gotten around to testing it yet. As for keyboard, you can use onboard for most applications or if the application is a QT application, it will pop up the system keyboard (behavior was exhibited by calibre)
ShadowEO said:
You could try the touchegg package for multi touch gestures, I haven't gotten around to testing it yet. As for keyboard, you can use onboard for most applications or if the application is a QT application, it will pop up the system keyboard (behavior was exhibited by calibre)
Click to expand...
Click to collapse
Thanks a lot for your answer. Sorry I don't know much yet about all this so my questions might be silly!
1) I installed touchegg but I don't know how to make it work
2) I have no keyboard in any app I installed (caja, gedit, firefox, ...)
Another question: I have a bq E4.5 and although I have 3.5G of free space on my internal memory the space available for apt-get-ed apps is much smaller (I have 50M left after installing just those few apps above). So no way to try libreoffice or other heavier app. Do you know if there is a solution for that?
Thank you very much!
takri said:
2) I have no keyboard in any app I installed (caja, gedit, firefox, ...)
Click to expand...
Click to collapse
If you use the matchbox setup I described above then you should have a keyboard.
Another question: I have a bq E4.5 and although I have 3.5G of free space on my internal memory the space available for apt-get-ed apps is much smaller (I have 50M left after installing just those few apps above). So no way to try libreoffice or other heavier app. Do you know if there is a solution for that?
Click to expand...
Click to collapse
This website describes a tweak to put the apt cache on an external SD card. It's in German, but the command lines should be clear enough. Let us know how it goes.
https://wiki.ubuntuusers.de/Ubuntu_Touch/Terminal/#Freien-Speicher-beobachten
You would need to run touchegg in the wrapper. Sadly wth keyboard, the only applications that will get the system keyboard are QT based applications. GTK+ and other applications will require onboard to be installed. I messed around with trying to install maliit-context-gtk2 to get the system keyboard to show in all apps, but that broke the keyboard completely.
Remember XMir is better used with a physical keyboard since it doesn't trigger the Ubuntu keyboard for everything.
You can also make the system img bigger if using MultiROM: you simply run e2fsck -fp /path/to/Ubuntu.IMG and resize2fs <target size> /path/to/Ubuntu.IMG.
ShadowEO said:
You would need to run touchegg in the wrapper.
Click to expand...
Click to collapse
I've played around with this a bit, but I can't get touchegg to work. I start an xmir application, then log in via ssh from my desktop. After setting the DISPLAY variable, I can start more X applications ok. After starting touchegg I see an output like this:
Code:
Reading config from "/home/phablet/.config/touchegg/touchegg.conf"
Try to make a multitouch gesture. If everything goes well the information about the gesture must appear
[+] Avaliable gesture:
Name -> Flick
[+] Avaliable gesture:
Name -> Drag
[+] Avaliable gesture:
Name -> Pinch
[+] Avaliable gesture:
Name -> Rotate
[+] Avaliable gesture:
Name -> Tap
[+] Avaliable gesture:
Name -> Touch
I assume that I am supposed to see some more output when a touch gesture is recognised by touchegg, but nothing ever shows up.
I can see touch events with either xinput or evtest
Code:
$ xinput test "xmir-fake-touch-pointer:0"
motion a[0]=36317 a[1]=42290
button press 1
motion a[0]=36590 a[1]=41730
motion a[0]=36645 a[1]=41275
motion a[0]=36536 a[1]=40469
motion a[0]=36263 a[1]=39524
motion a[0]=35935 a[1]=39034
motion a[0]=34897 a[1]=38019
motion a[0]=33532 a[1]=36934
motion a[0]=32713 a[1]=36303
motion a[0]=31839 a[1]=35778
motion a[0]=31293 a[1]=35533
motion a[0]=30856 a[1]=35323
motion a[0]=30638 a[1]=35253
motion a[0]=30419 a[1]=35148
motion a[0]=30255 a[1]=35078
motion a[0]=29928 a[1]=34903
motion a[0]=29873 a[1]=34868
motion a[0]=29873 a[1]=34868
motion a[0]=29873 a[1]=34868
button release 1
Code:
$ evtest /dev/input/event0
Input driver version is 1.0.1
Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0
Input device name: "elan-touchscreen"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event type 3 (EV_ABS)
Event code 47 (ABS_MT_SLOT)
Value 0
Min 0
Max 9
Event code 48 (ABS_MT_TOUCH_MAJOR)
Value 0
Min 0
Max 31
Event code 53 (ABS_MT_POSITION_X)
Value 0
Min 0
Max 1343
Event code 54 (ABS_MT_POSITION_Y)
Value 0
Min 0
Max 2239
Event code 57 (ABS_MT_TRACKING_ID)
Value 0
Min 0
Max 65535
Event code 58 (ABS_MT_PRESSURE)
Value 0
Min 0
Max 255
Properties:
Property type 1 (INPUT_PROP_DIRECT)
Testing ... (interrupt to exit)
Event: time 9936.473027, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1159
Event: time 9936.473088, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 12
Event: time 9936.473088, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 27
Event: time 9936.473118, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 338
Event: time 9936.473118, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 1059
Event: time 9936.473149, -------------- SYN_REPORT ------------
Event: time 9936.509709, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 11
Event: time 9936.509709, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 43
Event: time 9936.509709, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 351
Event: time 9936.509739, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 1061
Event: time 9936.509739, -------------- SYN_REPORT ------------
Event: time 9936.512791, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 46
Event: time 9936.512791, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 357
Event: time 9936.512791, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 1063
Some websites point to synclient for the configuration of touchegg, but that doesn't seem to work in Xmir:
Code:
$ synclient
Couldn't find synaptics properties. No synaptics driver loaded?
Does anyone else have more luck with touchegg?
While researching it, I stumbled over references to xSwipe, but I haven't looked into that any further.
ShadowEO said:
You would need to run touchegg in the wrapper. Sadly wth keyboard, the only applications that will get the system keyboard are QT based applications. GTK+ and other applications will require onboard to be installed. I messed around with trying to install maliit-context-gtk2 to get the system keyboard to show in all apps, but that broke the keyboard completely.
Click to expand...
Click to collapse
Just to reiterate, the matchbox-keyboard works fine for me!
Oh, and one thing I wanted to share: The firefox extension Grab and Drag allows a more natural touch screen style drag-to-scroll.
I completely forgot the matchbox keyboard while writing that reply, I'm not sure what's going on with touchegg as I haven't had a chance to play with it on Ubuntu touch. It could be that XMir isn't actually passing that much information about touch events.
matchbox-window-manager struggle
I am on the new Aquarius m10 Ubuntu tablet.
Tried to run tome applications and realized the X11 and Mir problem.
Came across your solution! Thank you for sharring!
Well, I dont seem to be able to install matchbox-window-manager
It shows a lot of missing dependencies and I am not abble to install them manually either..
The following packages have unmet dependencies:
matchbox-window-manager : Depends: libmatchbox1 (>= 1.7-1) but it is not going to be installed
Depends: libstartup-notification0 (>= 0.2) but it is not going to be installed
Depends: libxsettings-client0 but it is not going to be installed
Any light?? Thank you very much
eskizon said:
I am on the new Aquarius m10 Ubuntu tablet.
Tried to run tome applications and realized the X11 and Mir problem.
Came across your solution! Thank you for sharring!
Well, I dont seem to be able to install matchbox-window-manager
It shows a lot of missing dependencies and I am not abble to install them manually either..
The following packages have unmet dependencies:
matchbox-window-manager : Depends: libmatchbox1 (>= 1.7-1) but it is not going to be installed
Depends: libstartup-notification0 (>= 0.2) but it is not going to be installed
Depends: libxsettings-client0 but it is not going to be installed
Any light?? Thank you very much
Click to expand...
Click to collapse
Mhm, not sure. You do have set it to read-write and you did an apt update, right?
doniks said:
Mhm, not sure. You do have set it to read-write and you did an apt update, right?
Click to expand...
Click to collapse
Thanks for sharing this info! I also own the M10 ubuntu tablet and try to run some X11 apps.
I am able to apt-get matchbox-window-manager. But it won't start and says it can't find the display.
Running either:
Code:
matchbox-window-manager
matchbox-window-manager -d :0
as a normal user or root always returns: "can't open display! check your DISPLAY variable.".
ubuntu-pocket-desktop is up to date and I also set the DPI in ~/.Xdefaults.
What could be the reason it can't find the display? What could I try?
Tazard4 said:
What could be the reason it can't find the display?
Click to expand...
Click to collapse
You don't have an X server running. At least not at :0.
What could I try?
Click to expand...
Click to collapse
Follow the instructions in the original post or in my post #4.
Bumping this thread as I've edited the OP with the official instructions for running Legacy X Applications on Ubuntu Touch. As well as information about getting the system maliit-based OSK showing in X Applications (It's not that great though, you still may have better luck with matchbox-keyboard/on-board, but not sure how you'd even start those in Libertine.)

adb shell in recovery: 'pm list packages' fails from console

I wasn't paying attention to what I was doing after updating some apps, and froze some some application that is necessary, now my CATS60 will not boot. The app likely just uses the disable or hide command, but I am not sure what I misclicked, so I need to get a list or currently disabled apps or reenable all apps. I entered TWRP recovery, mounted all partitions, and connected through ADB shell.
This is what I get when I try to find out what's enabled/disabled:
Code:
# pm list packages
CANNOT LINK EXECUTABLE: library "libqc-opt.so" not found
page record for 0x7fb1658010 was not found (block_size=64)
adbd is running as root, and the file does exist:
Code:
~ # find / -name 'libqc-opt.so'
/system/vendor/lib/libqc-opt.so
/system/vendor/lib64/libqc-opt.so
I am using TWRP as recovery, and recovering system, data, and boot from backup does not fix this.
Does anyone know either
How can I make pm command work from recovery?
Where is the list of disabled apps stored, so I can manually edit it?
Thank you.
I found the list as used by the app (com.ramdroid.appquarantine), and it appears I blocked Google Calendar. However I have not found any way to "unfreeze" the app through recovery, this is simply a tracking file the app uses, not the actual enable/disable for Google Calendar.
Setting PATH and LD_LIBRARY_PATH environment variables does not help. Running it from inside the folder containing libqc-opt.so causes it to fail on a different external link.
Copying it to a second file called pm2, opening in vi and adding exports gets me as far as:
Code:
CANNOT LINK EXECUTABLE: cannot locate symbol "__android_log_close" referenced by "/system/lib64/libandroid_runtime.so"
Is it possible to chroot inside adb, and what do I need to mount first in order to do so? I don't know enough about Android to know which parts of the system I actually need.

[Guide] Linux on Wear OS!

THIS IS ONLY TESTED IN WEAR OS 3 ON A GALAXY WATCH 4
THOUGH THIS SHOULD WORK ON ALL WATCHES AND OLDER VERSIONS OF WEAR OS
Requirements:
ADB installed on your computer
Have your wear OS device connected to the same network as you computer
A bit of patience, this works in a very weird way!
Downloading apks and installing them
Firstly enable adb and adb debugging over WiFi on your wear OS device
Then download the latest apks:
Termux
MultiVnc If you want a graphical environment on Linux
When you have the apks run these commands:
Code:
adb connect IP_OF_YOUR_WEAR_OS_DEVICE
You might be able to see your ip under the button for enabling adb debugging over wifi
Then run these commands in the downloads folder
Code:
adb -s " IP_OF_YOUR_WEAR_OS_DEVICE" install NAME_OF_THE_DOWNLOADED_TERMUX_APK_FILE
and
Code:
adb -s " IP_OF_YOUR_WEAR_OS_DEVICE" install NAME_OF_THE_DOWNLOADED_MULTI-VNC_APK_FILE
BE AWARE THAT YOU MIGHT HAVE TO RESTART THE ADB CONNECTION, SOMETIMES IT MAY FREEZE.
to do that run
Code:
adb disconnect
then
Code:
adb connect IP_OF_YOUR_WEAR_OS_DEVICE
Installing Linux in Termux
Stay awake sleepyhead!
To make everything easier enable the option in Termux to keep your watch awake, this will save you from so much trouble.
First open up Termux, then long press the black background.
Then press the three dots and choose the option "More...".
Scroll down until you see the option "Keep screen on", turn on that.
Keyboard?
I've discovered that there's a problem with Wear OS keyboards, for some reason they might not interact properly with certain android applications.
So open up Termux in your Wear OS device and see if you can write anything in Termux.
If that works, see if there's any enter button on your keyboard and see if it works.
If Termux gave any response to what you entered then skip this part and head straight for "The Linux multiverse!"
If the enter button doesn't work then you gotta install an android keyboard.
The best keyboard I've found that also works on round Wear OS devices is "Unexpected keyboard"
Download the keyboard and run:
Code:
adb -s " IP_OF_YOUR_WEAR_OS_DEVICE" install NAME_OF_THE_DOWNLOADED_KEYBOARD_APK_FILE
When the keyboard is installed change you default keyboard into the previously installed keyboard.
The Linux multiverse!
On your ANDROID PHONE install Andronix.
In there you will have a lot of options for installing Linux on Termux. You can choose whatever you want!
When you've chosen what you want, then Andronix will copy a command to your phones clipboard.
Oh no!
This is where you might only have a few options!
The problems is that you have to get the command from your phone to your Wear OS device, though your Wear OS device might not even let you copy and paste!
Though there is a way to bypass this, ANDROID APPS! The easiest way is to install messenger lite(not messenger for Wear OS).
First download Messenger lite. (source for the messenger download link)
Then In the downloads folder run:
Code:
adb -s " IP_OF_YOUR_WEAR_OS_DEVICE" install NAME_OF_THE_DOWNLOADED_MESSENGER_APK_FILE
Log into messenger on your phone and your Wear OS device.
On your phone send the command Andronix gave you, to yourself in messenger.
Then open up messenger on your Wear OS device and long press the command and select copy!
Now the biggest hassle is gone!
The long, really long awakening
Now that you've copied the command, enter Termux. Then long press the black background and press paste.
NOW DON'T TOUCH ANYTHING, so that you don't accidentally change anything in the command.
From your computer run:
Code:
adb shell input keyevent 66
Try to remember this command, or put it somewhere easy to copy. You'll need it pretty often. (this command serves as an enter button)
The installation of Linux will now begin, there will be some Y/N questions, just choose the default options by running:
Code:
adb shell input keyevent 66
After a while you might get questions about region, keyboard and such.
use
Code:
adb shell input keyevent 66
to scroll down when it says [MORE]
then use
Code:
adb shell input text "NUMBER/WORD"
(don't remove the parentheses)
then again use
Code:
adb shell input keyevent 66
as an enter button
It might also ask you for a vnc password, choose a small and easy password.
FINALLY LINUX!
You should now have Linux installed on your Wear Os device. Go do whatever you want with it.
Just remember that your Wear OS device uses arm, so if you wanna use x86 applications, then you gotta use Box64 if you have a 64-bit processor and Box86 if you have a 32-bit processor
Start Linux(Linux might automatically start after installation)
First run:
Code:
adb shell input text "ls"
Code:
adb shell input keyevent 66
This will run the ls command.
Look for a file closely name to start-SOME_LINUX_DISTRO.sh or start-andronix.sh
then run:
Code:
adb shell input text "./start-SOME_LINUX_DISTRO"
then
Code:
adb shell input keyevent 66
BOOM Linux is now running :3
What about GUI?
If you installed a Linux version with a graphical interface then you either gotta use a VNC to display anything on your watch
run
Code:
adb shell input text "vncserver-start"
then
Code:
adb shell input keyevent 66
then
Code:
adb shell input keyevent 66
The terminal will say " New 'remote-desktop' at :NUMBER on machine localhost "
remember that number
now exit Termux and start Mutli-Vnc
Scroll down to "New Connection"
in Address enter localhost
in port enter 590 and then the number. (If the number as is higher than 9, enter 59 and then the number)
Scroll down password and enter in the vnc password you chose earlier.
Then the scroll all the way down and press the big green "Connect" button!
You should now some something, maybe not a lot, but something"
You can manually set the resolution if you want, so that you're able to utilize the screen better, go here for a guide on that.
External GUI
If you actually wanna use the Linux installation, then you'll have to use an external device to view the desktop.
You can follow this guide here, as it's better at explaining then me.
You can also use this guide if you wanna use XSDL.
A tip for entering &, use the keyboard on the watch! Also the read the explanation of commands before you continue, you'll need it!
Command explanation!!
adb shell input text " " will enter any text into the connected adb device, %s is used for spaces
adb shell input keyevents will do any key event, like pressing enter, 66 is for enter
If something doesn't work, let me know. I might've missed something!

Categories

Resources