Quick right-click scripts commonly used in Linux daily work (mainly Android apps)

Source: Internet
Author: User

Linux provides a convenient personalization in the context of a custom right-click Operation relative to the Windows system, just to create a new script file inside the ~/.gnome2/nautilus-scripts file. Due to the bloggers engaged in andriod work, the following mainly describes the daily work needs to use the script:


1. First, in the terminal input path ~/.gnome2/nautilus-scripts, and then directly enter the Gedit name.txt (or directly into the file system to enter the path of the new script file);


2. Enter the following command in the text edit box that opens:


(1) Install the APK file directly, Gnome-terminal is displayed during the execution of the terminal,

$NAUTILUS _script_selected_file_paths is the right-click Install apk file, usually installed in daily work with the-R parameter, which covers the apk installed on the phone, and-s The parameter indicates that the file will be installed on the phone's SD card: (same as below)


gnome-terminal-e "adb install-rs $NAUTILUS _script_selected_file_paths"


(2) Pull the mobile file to the corresponding directory of the computer, to use the pulling command:

gnome-terminal-e "adb pull a path (computer path) b Path (phone path, General/sdcard/start)"


Conversely, if you pull a computer file into your phone, the push command is used:


gnome-terminal-e "adb push b Path (phone path, General/sdcard/start) a path (computer path)"


(3) Put the current phone interface and pull it into the computer:


adb shell/system/bin/screencap-p/sdcard/hello.png

; Connect the phone shell, call the phone/system/Directory command, will be saved in the/sdcard/directory, and named Hello in the PNG format Picture:


adb pull/sdcard/hello.png computer catalog/Picture name

and pull it into the computer-made catalogue.


Operation to here has actually completed the mobile phone pull to the computer steps, but it is possible to upload the image does not automatically generate the ideal PNG format (you can default to open as a picture, but the picture sent to the other party is not recognized as a picture), so we can add in the script to modify the upload Image Format command:


mv directory/Picture name directory/Picture name. PNG


Finally, the phone generated by the deletion, do not waste memory:


adb shell rm/sdcard/hello.png


(4) In addition, in our work can not avoid the use of Eclipse log or in the DDMS memory and CPU analysis provided in the image analysis, do not want to do copy and paste duplication operation, directly is a good choice. But on the computer only a full-screen shortcut is provided, so here is a script to select any area:


gnome-screenshot-a


Just right click on our new script, then you can long press the left mouse button to select any area, release the mouse button to complete the copy and paste operation, save the picture is generally in the file system inside the "picture" directory. Of course, you can also choose the directory you specify to save, here is not a cumbersome introduction.


(5) Finally, a simple script to run the application is introduced. If we don't put a app on the desktop shortcut (someone doesn't like too many app icons flooding the desktop, it's not nice), we can right-click directly to find the directory to run the A program and run the application:


Storage directory for CD a application

. /a applications;./Applications---commands for running applications on Linux systems


3. After the script is written, the file to be called to save the exit. Next, to make the most important step, modify the file permissions. Because in the Linux system, the privilege is a very important access rule, here is not described in detail. After saving, enter the command inside the terminal:


chmod 777 New script name


You can use the command ls to display the file in the current directory to see if the color changes before and after the script file you have written.



Here, the script will be able to use the normal, quickly try to write your own shortcuts ~


Quick right-click scripts commonly used in Linux daily work (mainly Android apps)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.