-2

For instance if I wanted to type

$Ctrl+Alt+Delete

and it would return the same as

$reboot

this way when editing custom taskbar launchers we can execute key commands via terminal. Would I write a bash script or is there an editable script where commands such as reboot live? Sorry if this was over your head those of you who down voted for no reason rather than answering.

  • See: http://askubuntu.com/a/254425/158442 and http://askubuntu.com/a/39851/158442 – muru Oct 17 '14 at 05:06
  • 1
    Your question is very unclear. Do you actually want to type that into the command line (as your question indicates since you have added the $ prompt) or do you want to make those keys a shortcut for a specific command? The two are completely different. – terdon Oct 17 '14 at 12:24
  • I dont know how to be more clear I want to type LCtrl+LAlt+Delete into a launchers terminal field. I want written keyboard shortcuts to work in terminal to make touchable buttons that perform keyboard shortcuts via terminal. – user2218260 Oct 17 '14 at 22:02
  • xdotool gave me the functionality necessary to carry out key stroke via command line...this should not require an application written keystrokes should be a stock functionality of terminal to make ubuntu more touch friendly. – user2218260 Oct 18 '14 at 17:20

2 Answers2

1

Well, you could type the following commands. When typing, make CUSTOMCOMMAND what you want the command to be when you type it in the terminal.sudo su, cd /usr/bin, nano CUSTOMCOMMAND. Then, write #!/bin/bash and make a little script of what yo want to happen when you run your command. Then press Ctrl+X when done, answer y, press Enter, and chmod +x CUSTOMCOMMAND. That command should now work, no reboot should be needed. The command might only work for root. You'll have to change the file permissions to fix that.

John Scott
  • 1,462
  • 7
  • 24
  • 48
  • But isn't there already a bash script somewhere that contains mundane commands like (reboot)? – user2218260 Oct 17 '14 at 04:13
  • It seems a little bit disorganized for an OS to not have a manifest of basic commands. – user2218260 Oct 17 '14 at 05:08
  • I mean even in low level programming there are auto generated files that the basic command structure references to/from. – user2218260 Oct 17 '14 at 05:11
  • 1
    @user2218260 you're not very clear about what you want. Define "basic", for example. What auto-generated files are you talking of? – muru Oct 17 '14 at 05:36
  • Ok for instance there should be terminal commands for every window action such as minimize, maximize, exit, and show desktop I'm trying to make menu bar buttons that do the same functions as keyboard shorcuts ie. making ubuntu more touch friendly less buttin mashing on the keyboard see attached image of Android like buttons that perform window operations. – user2218260 Oct 17 '14 at 21:49
  • https://drive.google.com/file/d/0B0aJ_7pXV1-EaFhZdUJWUzU3Mkk/view?usp=sharing – user2218260 Oct 17 '14 at 21:50
  • Ive gotten all of the buttons mapped with the exception of the back button this would require Backspace to be executed as a terminal command and home this would require Show Desktop or minimize -all to be run as a terminal command. – user2218260 Oct 17 '14 at 21:55
  • I installed xdotool this gave terminal functionality to keystrokes/keyboard shortcuts...xdotool was just what was needed to make Ubuntu more touch friendly. In conclusion if you need to create a button from an launcher that requires a terminal command to execute but the command is a window opperation only scripted for shortcuts xdotool allwos you to create keyboard based commands that are executable by terminal. In this manner.

    xdotool Key BackSpace

    – user2218260 Oct 18 '14 at 17:26
  • muru as far as the files I speak of at least in Java (I know linux/unix isnt java) there is a manifest and an R.java file that is autogenerated where references to all of the objects live now linux should have a similar file that has all of the usable terminal command references thats editable so that commands can be added or subtracted....No? – user2218260 Oct 18 '14 at 17:34
1

You can add custom Bash commands in your bash profile. From terminal:

echo "custom_command(){ userdir=$(cd ~ && pwd); echo $userdir; }" >> ~/.bash_profile
source ~/.bash_profile

Then try it out from terminal:

custom_command