[APP] CommandCenter the power of shell without having to use the termina - Optimus One, P500, V General

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!

Related

[BETA]CASUAL Online Update System and Kill-Switch

Hey guys,
I need help testing CASUAL. I've been working on CASUAL for almost a year now. Currently I'm working on bringing real-time updates and a kill-switch in the event the GNote2 unlock starts bricking devices. I need tesing on the ability to push a new revision, and the "kill-switch".
Intent
I need help testing new features on your computer because they work on mine. The tests will do nothing except reboot your device. The update system is pretty critical and potentially show-stopping. It will be in every CASUAL, including the GNote2 Unlock (for safety reasons) as soon as this test is complete.
Scripts
Here is what I need tested:
1. Kill Switch -- If you are connected to the internet, it will shutdown CASUAL, display a message, then open a browser and take you somewhere where you can get more information.
2. Update Required -- Will download the latest versions of the "Update Required" script and files ONLY one time per run. These files come from the CASUAL Subversion repository located here, then your device will reboot.
3. Update Not Required -- Will reboot your device. This is the "control" subject.
Download CASUAL R180 Build2,846
Obtaining a log
If you see a problem, Click About>Show Log>Copy to Clipboard then paste it into a code box here on XDA. Or if you wish to copy the terminal output from "java -jar path_to/casual.jar" that's fine too.
Privacy
No information is sent from your computer. CASUAL determines if it needs an update by looking at the online version and pulling required files off the internet.
SVN Revision: 169
CASUAL Build Number: 2,792
Problems known at release: none
Problems Identifed:
Kill Switch/update downloaded message contains no spaces.
SVN Revision 180
CASUAL Build Number:2846
Corrected killswitch/update messages, removed unused imports, cleaned up and relicensed code under GPL instead of MIT
Problems known at release: none
Problems Identifed: none
AdamOutler said:
Hey guys,
I need help testing CASUAL. I've been working on CASUAL for almost a year now. Currently I'm working on bringing real-time updates and a kill-switch in the event the GNote2 unlock starts bricking devices. I need tesing on the ability to push a new revision, and the "kill-switch".
Intent
I need help testing new features on your computer because they work on mine. The tests will do nothing except reboot your device. The update system is pretty critical and potentially show-stopping. It will be in every CASUAL, including the GNote2 Unlock (for safety reasons) as soon as this test is complete.
Scripts
Here is what I need tested:
1. Kill Switch -- If you are connected to the internet, it will shutdown CASUAL, display a message, then open a browser and take you somewhere where you can get more information.
2. Update Required -- Will download the latest versions of the "Update Required" script and files ONLY one time per run. These files come from the CASUAL Subversion repository located here, then your device will reboot.
3. Update Not Required -- Will reboot your device. This is the "control" subject.
Download CASUAL R169 Build2,792
Obtaining a log
If you see a problem, Click About>Show Log>Copy to Clipboard then paste it into a code box here on XDA. Or if you wish to copy the terminal output from "java -jar path_to/casual.jar" that's fine too.
Privacy
No information is sent from your computer. CASUAL determines if it needs an update by looking at the online version and pulling required files off the internet.
Click to expand...
Click to collapse
How long does it take to update? I have the "Script is out of date" message. Says updating...then the Youshouldseethismessagebecauseitsimportant message".....but so far no reboot...it's been about four minutes.
Here's the log -
Code:
Created Folder:C:\Users\User\AppData\Local\Temp\UserTEMPCASUAL232BF7BD\
Control Change requested but Statics.MasterLock is set.
OMFGWOOT
This is a test of CASUAL's new update system. Please leave feedback.
Deploying ADB
Searching for scripts
null
Picking Jar File:/D:/Download/CASUAL-Revision169b.jar
Found Windows Computer
Attempting to write C:\Users\User\AppData\Local\Temp\UserTEMPCASUAL232BF7BD\Elevate.exe
File verified.
Attempting to write C:\Users\User\AppData\Local\Temp\UserTEMPCASUAL232BF7BD\adb.exe
Found: Kill-Switched
Found: Update Not Required
Found: Update Required
From Resource: true
--Kill-Switched--
Exiting comboBoxUpdate()
File verified.
Attempting to write C:\Users\User\AppData\Local\Temp\UserTEMPCASUAL232BF7BD\AdbWinApi.dll
File verified.
Attempting to write C:\Users\User\AppData\Local\Temp\UserTEMPCASUAL232BF7BD\AdbWinUsbApi.dll
File verified.
Attempting to write C:\Users\User\AppData\Local\Temp\UserTEMPCASUAL232BF7BDadb_usb.ini
File verified.
###executing: C:\Users\User\AppData\Local\Temp\UserTEMPCASUAL232BF7BD\adb.exe###
State Change Detected, The new state is: 1
State Connected
device
Device List:List of devices attached 014E5ABE06004016 device
Controls Enabled status: true
StartButtonActionPerformed() Script Activated
Script known as Kill-Switched is running
Controls Enabled status: false
Script Kill-Switched returned #0Kill-Switched
Selected resourceKill-Switched
Lines in Script 4
Executing Scripted [email protected]
CASUAL has initiated a multithreaded execution environment
Script Kill-Switched returned #0Kill-Switched
Script is out of date. See http://forum.xda-developers.com/search.php?do=finduser&u= for more information. Updating.
Youshouldseethismessagebecauseitsimportant--AdamOutler
Okay...re-read your instructions again...Chose "Kill Switch" and the above happens.
Chose "Update required" and it give the "Cool" message.
Chose "Update not required" and it rebooted.
I think those were the expected results, yes? FYI - I have a Mot. Razr Maxx....
just4sc said:
How long does it take to update? I have the "Script is out of date" message. Says updating...then the Youshouldseethismessagebecauseitsimportant message".....but so far no reboot...it's been about four minutes.
Here's the log -
Code:
Created Folder:C:\Users\User\AppData\Local\Temp\UserTEMPCASUAL232BF7BD\
Control Change requested but Statics.MasterLock is set.
OMFGWOOT
This is a test of CASUAL's new update system. Please leave feedback.
Deploying ADB
Searching for scripts
null
Picking Jar File:/D:/Download/CASUAL-Revision169b.jar
Found Windows Computer
Attempting to write C:\Users\User\AppData\Local\Temp\UserTEMPCASUAL232BF7BD\Elevate.exe
File verified.
Attempting to write C:\Users\User\AppData\Local\Temp\UserTEMPCASUAL232BF7BD\adb.exe
Found: Kill-Switched
Found: Update Not Required
Found: Update Required
From Resource: true
--Kill-Switched--
Exiting comboBoxUpdate()
File verified.
Attempting to write C:\Users\User\AppData\Local\Temp\UserTEMPCASUAL232BF7BD\AdbWinApi.dll
File verified.
Attempting to write C:\Users\User\AppData\Local\Temp\UserTEMPCASUAL232BF7BD\AdbWinUsbApi.dll
File verified.
Attempting to write C:\Users\User\AppData\Local\Temp\UserTEMPCASUAL232BF7BDadb_usb.ini
File verified.
###executing: C:\Users\User\AppData\Local\Temp\UserTEMPCASUAL232BF7BD\adb.exe###
State Change Detected, The new state is: 1
State Connected
device
Device List:List of devices attached 014E5ABE06004016 device
Controls Enabled status: true
StartButtonActionPerformed() Script Activated
Script known as Kill-Switched is running
Controls Enabled status: false
Script Kill-Switched returned #0Kill-Switched
Selected resourceKill-Switched
Lines in Script 4
Executing Scripted [email protected]
CASUAL has initiated a multithreaded execution environment
Script Kill-Switched returned #0Kill-Switched
Script is out of date. See http://forum.xda-developers.com/search.php?do=finduser&u= for more information. Updating.
Youshouldseethismessagebecauseitsimportant--AdamOutler
Okay...re-read your instructions again...Chose "Kill Switch" and the above happens.
Chose "Update required" and it give the "Cool" message.
Chose "Update not required" and it rebooted.
I think those were the expected results, yes? FYI - I have a Mot. Razr Maxx....
Click to expand...
Click to collapse
I'm pushing out the kill switch now. http://code.google.com/p/android-casual/source/list
AdamOutler said:
Hey guys,
I need help testing CASUAL. I've been working on CASUAL for almost a year now. Currently I'm working on bringing real-time updates and a kill-switch in the event the GNote2 unlock starts bricking devices. I need tesing on the ability to push a new revision, and the "kill-switch".
Intent
I need help testing new features on your computer because they work on mine. The tests will do nothing except reboot your device. The update system is pretty critical and potentially show-stopping. It will be in every CASUAL, including the GNote2 Unlock (for safety reasons) as soon as this test is complete.
Scripts
Here is what I need tested:
1. Kill Switch -- If you are connected to the internet, it will shutdown CASUAL, display a message, then open a browser and take you somewhere where you can get more information.
2. Update Required -- Will download the latest versions of the "Update Required" script and files ONLY one time per run. These files come from the CASUAL Subversion repository located here, then your device will reboot.
3. Update Not Required -- Will reboot your device. This is the "control" subject.
Download CASUAL R169 Build2,792
Obtaining a log
If you see a problem, Click About>Show Log>Copy to Clipboard then paste it into a code box here on XDA. Or if you wish to copy the terminal output from "java -jar path_to/casual.jar" that's fine too.
Privacy
No information is sent from your computer. CASUAL determines if it needs an update by looking at the online version and pulling required files off the internet.
Click to expand...
Click to collapse
This is revolutionizing android and fast. i love you.
Everything appears to be working great Adam.
Thanks.
I've just relesed the following build. All previous scripts should be killswitched. Please test this and verify that there are no errors.
SVN R180
CASUAL Build Number:2846
Corrected killswitch/update messages, removed unused imports, cleaned up and relicensed code under GPL instead of MIT
Problems known at release: none
Problems Identifed: none
Sorry, I uploaded the wrong file. Correct file is up now. There should be no problems now.
Please let me know if this works and what OS you are using.
Windows 7 here, everything looks good, but it did not reboot after I got the "cool" message when doing the update required choice.
B-Mod said:
Windows 7 here, everything looks good, but it did not reboot after I got the "cool" message when doing the update required choice.
Click to expand...
Click to collapse
Could you please grab the log from about>show log>copy to clipboard.. Then paste it here in
Code:
tags?
Created Folder:C:\Users\HTPC\AppData\Local\Temp\HTPCTEMPCASUAL59652B83\
Control Change requested but Statics.MasterLock is set.
OMFGWOOT
Testing CASUAL's ability to update
Deploying ADB
Searching for scripts
null
Found Windows Computer
Picking Jar File:/C:/Users/HTPC/Desktop/CASUAL-Revision180b(1).jar
Attempting to write C:\Users\HTPC\AppData\Local\Temp\HTPCTEMPCASUAL59652B83\Elevate.exe
File verified.
Attempting to write C:\Users\HTPC\AppData\Local\Temp\HTPCTEMPCASUAL59652B83\adb.exe
Found: Kill-Switched
Found: Update Not Required
Found: Update Required
Updating Scripts for UI
From Resource: true
--Kill-Switched--
Exiting comboBoxUpdate()
File verified.
Attempting to write C:\Users\HTPC\AppData\Local\Temp\HTPCTEMPCASUAL59652B83\AdbWinApi.dll
File verified.
Attempting to write C:\Users\HTPC\AppData\Local\Temp\HTPCTEMPCASUAL59652B83\AdbWinUsbApi.dll
File verified.
Attempting to write C:\Users\HTPC\AppData\Local\Temp\HTPCTEMPCASUAL59652B83\adb_usb.ini
File verified.
###executing: C:\Users\HTPC\AppData\Local\Temp\HTPCTEMPCASUAL59652B83\adb.exe###
State Change Detected, The new state is: 1
device
State Connected
Device List:List of devices attached 42f73b16cf4d9f95 device
Controls Enabled status: true
From Resource: true
--Update Required--
Exiting comboBoxUpdate()
StartButtonActionPerformed() Script Activated
Script known as Update Required is running
Controls Enabled status: false
Script Update Required returned #2Update Required
Selected resourceUpdate Required
Lines in Script 4
Executing Scripted [email protected]
CASUAL has initiated a multithreaded execution environment
Script Update Required returned #2Update Required
Script is out of date. See http://forum.xda-developers.com/showthread.php?t=2105263 for more information. Updating.
CASUAL was updated to the latest greatest version of this script. Cool huh? --AdamOutler
---------- Post added at 07:52 PM ---------- Previous post was at 07:51 PM ----------
Code:
Created Folder:C:\Users\HTPC\AppData\Local\Temp\HTPCTEMPCASUAL59652B83\
Control Change requested but Statics.MasterLock is set.
OMFGWOOT
Testing CASUAL's ability to update
Deploying ADB
Searching for scripts
null
Found Windows Computer
Picking Jar File:/C:/Users/HTPC/Desktop/CASUAL-Revision180b(1).jar
Attempting to write C:\Users\HTPC\AppData\Local\Temp\HTPCTEMPCASUAL59652B83\Elevate.exe
File verified.
Attempting to write C:\Users\HTPC\AppData\Local\Temp\HTPCTEMPCASUAL59652B83\adb.exe
Found: Kill-Switched
Found: Update Not Required
Found: Update Required
Updating Scripts for UI
From Resource: true
--Kill-Switched--
Exiting comboBoxUpdate()
File verified.
Attempting to write C:\Users\HTPC\AppData\Local\Temp\HTPCTEMPCASUAL59652B83\AdbWinApi.dll
File verified.
Attempting to write C:\Users\HTPC\AppData\Local\Temp\HTPCTEMPCASUAL59652B83\AdbWinUsbApi.dll
File verified.
Attempting to write C:\Users\HTPC\AppData\Local\Temp\HTPCTEMPCASUAL59652B83\adb_usb.ini
File verified.
###executing: C:\Users\HTPC\AppData\Local\Temp\HTPCTEMPCASUAL59652B83\adb.exe###
State Change Detected, The new state is: 1
device
State Connected
Device List:List of devices attached 42f73b16cf4d9f95 device
Controls Enabled status: true
From Resource: true
--Update Required--
Exiting comboBoxUpdate()
StartButtonActionPerformed() Script Activated
Script known as Update Required is running
Controls Enabled status: false
Script Update Required returned #2Update Required
Selected resourceUpdate Required
Lines in Script 4
Executing Scripted [email protected]
CASUAL has initiated a multithreaded execution environment
Script Update Required returned #2Update Required
Script is out of date. See http://forum.xda-developers.com/showthread.php?t=2105263 for more information. Updating.
CASUAL was updated to the latest greatest version of this script. Cool huh? --AdamOutler
Adam, did you figure out why the phone did not reboot?
Try this one. This includes all my latest changes..
Added Fastboot support
Added Killswitch support
Added Automatic Downloads
Added MD5 integrity checks
--Also-- Added "double-click-enable" on status button. If you really want to use a fastboot-only script but your device isn't capable of adb reboot bootloader, double-click the "device status" and it will enable things as though a device were connected.
Download Here: http://d-h.st/JlJ
AdamOutler said:
Try this one. This includes all my latest changes..
Added Fastboot support
Added Killswitch support
Added Automatic Downloads
Added MD5 integrity checks
--Also-- Added "double-click-enable" on status button. If you really want to use a fastboot-only script but your device isn't capable of adb reboot bootloader, double-click the "device status" and it will enable things as though a device were connected.
Download Here: http://d-h.st/JlJ
Click to expand...
Click to collapse
Sorry, but I won't be able to test it till Thursday night, as I am working out of town and not near my PC.
AdamOutler said:
Try this one. This includes all my latest changes..
Added Fastboot support
Added Killswitch support
Added Automatic Downloads
Added MD5 integrity checks
--Also-- Added "double-click-enable" on status button. If you really want to use a fastboot-only script but your device isn't capable of adb reboot bootloader, double-click the "device status" and it will enable things as though a device were connected.
Download Here: http://d-h.st/JlJ
Click to expand...
Click to collapse
All seems to run well here.
--Test Script--
Testing Testing Revision 1
Script is out of date. See http://xda-developers.com for more information. Updating.
OMFG TESTING meta information
Downloading Updates
Test Script.scr...4kb Test Script.zip...1880kb Test Script.txt...4kb ... Update Sucessful! MD5s verified!
rebooting with ADB
rebooting with Fastboot
Running Windows 7.
I will test this tonight when I get home.

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

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.

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.

Screen turns on frequently, what program is doing that?

Every couple of minutes, sometimes sooner, my screen will turn on. It is sitting on a table untouched. I know that that can be done programmatically. I don't think it's a touchscreen problem of spurious ghost presses, this never happens when I am using the touchscreen. I would like to find out what is causing it. Are there any tools for logging what program made the screen-ON request?
Thanks in advance.
@Gorilla Daddy
Android logs all - unless this got disabled - what happens - keyword: LOGCAT. You can look inside this protocol by means of ADB
Examples:
Code:
adb devices
adb logcat
2nd command will generate real-time output in command window. It can be stopped with CTRL+C
Code:
adb devices
adb logcat -d > C:\logcat.txt
2nd command will extract the logcat information from the connected device and redirects the output to a file on the PC.
The option –d will take care that the output will stop when all output is flushed.

[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