LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Bodhi
User Name
Password
Bodhi This forum is for the discussion of Bodhi Linux.

Notices


Reply
  Search this Thread
Old 07-06-2020, 04:00 AM   #1
questionsBot
Member
 
Registered: Jun 2020
Posts: 94

Rep: Reputation: Disabled
How can I make a script apear as an icon in the menu or my favorites so i can run form the menu instead of the console?


I have a script that disabled my keyboard compleatly and enables it if the script is run a second time. I needed this as my laptop folds into a tablet. When you use the laptop in this mode, it needs the entire keyboard to be disabled. In windows it automatically disables and enabled the keyboard, but I just can't get it to do that in Linux.

So I wrote a simple script that enables or disabled the keyboard for me.

Quote:
Originally Posted by sKeyboardSwap
#! /bin/bash
# sKeyboard
# http://ubuntuforums.org/showthread.php?t=2100744

DEVICE="AT Translated Set 2 keyboard"
STATUS=`xinput list-props "$DEVICE" | grep 'Device Enabled' | sed 's/.*\([0-9]\)$/\1/'`

if [ "$STATUS" = "1" ]
then
xinput set-prop "$DEVICE" 'Device Enabled' 0
#echo "KeyBoard Disabled"
# notify-send "Touch-screen" "Disabled" -i /usr/share/pixmaps/touch-screen.png
elif [ "$STATUS" = "0" ]
then
xinput set-prop "$DEVICE" 'Device Enabled' 1
#echo "KeyBoard Enabled"
# notify-send "Touch-screen" "Enabled" -i /usr/share/pixmaps/touch-screen.png
else
echo "Error : bad argument"
fi
This seems to work fine. The thing is as it disables the keyboard I can't enable in the terminal, I need to click the actual script in my fie manager and execute it.

: TL;DR :

How can I turn this script into a entry in the actual BodHi menu, with an Icon and everything. So I can simply click my desktop, go favorites and click the icon to disable, and enable the keyboard?

Thanks!
 
Old 07-06-2020, 04:06 AM   #2
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 1,125

Rep: Reputation: Disabled
Desktop Entry Specification
 
1 members found this post helpful.
Old 07-06-2020, 06:45 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 14,904
Blog Entries: 9

Rep: Reputation: 4208Reputation: 4208Reputation: 4208Reputation: 4208Reputation: 4208Reputation: 4208Reputation: 4208Reputation: 4208Reputation: 4208Reputation: 4208Reputation: 4208
^ yeah I thought you talked about this in your other thread? No need to start a new one afaics.

Anyhow, create a file e.g. "$HOME/.local/share/applications/keyboard.desktop" with the following content:
Code:
[Desktop Entry]
Version=1.0
Type=Application
Name=something
Exec=/path/to/script
Icon=someicon
Terminal=false
StartupNotify=false
Categories=System;
(not tested)

The next time your menu is updated, it should show up under System.
 
Old 07-06-2020, 09:28 PM   #4
cordx
Member
 
Registered: Oct 2018
Location: texas
Distribution: bodhi 5.1.0
Posts: 696

Rep: Reputation: 158Reputation: 158
Quote:
Originally Posted by shruggy View Post
thanks for sharing that resource. i had always just looked at the examples on my system. reading through the specs has been helpful and informative.
 
Old 07-06-2020, 10:17 PM   #5
enigma9o7
Member
 
Registered: Jul 2018
Location: Silicon Valley
Distribution: Bodhi 5 (Ubuntu 18.04)
Posts: 518

Rep: Reputation: 192Reputation: 192
Quote:
Originally Posted by questionsBot View Post
I needed this as my laptop folds into a tablet. When you use the laptop in this mode, it needs the entire keyboard to be disabled. In windows it automatically disables and enabled the keyboard, but I just can't get it to do that in Linux.
I bet you can bind folding it to disable keyboard automatically... probably ACPI bindings? Or maybe key bindings. Both in settings panel under input. Then bind them to your script. See if it can "add" that action.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
fedora 15 system dies not apear to be logging events ? b_unix Fedora 2 03-15-2012 06:10 AM
Recovering Mozilla Favorites menu fstreed Linux - Desktop 2 01-12-2009 04:35 PM
Drives mounted with ntfs-3g don't apear on the desktop and in File Browser tvcool Fedora 1 03-10-2007 06:21 AM
Desktop icons dosnt have ToolTips (apear when mouse hover above desktop icon) Acidx Linux - General 1 12-03-2006 07:48 PM
How do I enlarge the menu for favorites and news feeds in firefox? bruno buys Linux - Software 0 05-06-2005 09:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Bodhi

All times are GMT -5. The time now is 08:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration