Wednesday, November 25, 2015

How to Add Low Battery Warning on OpenSUSE

Simply follow these steps:

If you prefer to do it using a GUI, you can go to the Software Center and install Scheduled tasks (or run sudo zypper install gnome-schedule). It will provide a powerful GUI to add cron tasks.

Note that if you use this method, tasks by default will be executed as your own user, not as root. This is usually a good thing.

Once installed this application, search "Scheduled Tasks" and Open it.
Now, Click on New
Click on "A task that launches recurrently"
Now Add description for example: VK Battery Check
On the command, Add: /home/vkpandey/Extras/scripts/CheckBattery.sh
On the Time and Date Option, click on Advanced
In the Minute section, add */5 that means at minute: */5 (in every 5 minutes)
and leave Hour, Day, Month, Weekday *


Now create a following CheckBattery.sh script in any location (For example: /home/vkpandey /Extras/scripts)

#!/bin/bash
BATTERY=$(upower -e | grep 'BAT')
while [ 1 ]
do
    BATTERY_PERCENTAGE=$(upower -i $BATTERY|grep percentage|awk '{ print $2 }'|sed s/'%'/''/g)
    if [[ "$BATTERY_PERCENTAGE" -lt "20" ]]; then
    notify-send --urgency=critical "WARNING: Battery is about to die"  "Hello Vijaya!! Plug in the power cable"
    play /usr/share/sounds/KDE-Sys-Warning.ogg &> /dev/null
    fi
sleep 10
done
**Don't forget the file permission of CheckBattery.sh

Now All Done!

Assign Win + E Key to Open Home Folder [OpenSUSE]

Here is the trick to Assign Win + E Key to Open Home Folder [OpenSUSE]:

1. go to Settings.
2. search for Keyboard.
3. Move to tab "shortcuts"
4. Go to Launchers
5. Click on "Home Folder" option.
6. Click on the right side (you will see New Accelerator or something)
7. press windows + E (also called Super + E)
8. Now on the right side it shows "Super + E"

Finally you're done. That will create a keyboard shortcut to open home folder. Press Super + E to see the result.

Monday, November 23, 2015

Show Desktop Items on OpenSUSE

To show the desktop items on OpenSUSE, follow these steps:

1. Type Tweak Tool on search bar.
2. Go to Desktop tab
3. On the Top Right Side, change Off button to On.

Now, you're all set.

How to Hide All Normal Windows on OpenSUSE?

Here is the trick to show desktop / hide all normal windows on OpenSUSE:

1. go to Settings.
2. search for Keyboard.
3. Move to tab "shortcuts"
4. Go to Navigation
5. Scroll down to find "Hide All Normal Windows".
6. Click on the right side (you will see New Accelerator or something)
7. press windows + D (also called Super + D)
8. Now on the right side it shows "Super + D"

Finally you're done. Press Super + D to see desktop.

Monday, November 16, 2015

Wednesday, November 11, 2015

Start PhpMyAdmin OpenSUSE

Go to Terminal and Run:

/opt/lampp/lampp restart

     /opt/lampp/lampp start

Run Gringo/Clingo Successfully on OpenSUSE [Gringo Not Working on OpenSUSE - FIXED!]

With the recent gringo/clingo sources, no configuration should be necessary (under (most) linuxes).
However you have to make sure the installation of the development package of python.

To install the necessary packages:
  sudo zypper in python-devel lua-devel bison scons re2c

For threading support, you also need Intel's tbb. It is in the education repository.
  sudo zypper in tbb-devel

Add Clingo Path to Environment Variable [OpenSUSE]

1. Open Terminal
2. Type the following Command:

vi ~/.bashrc

3. Add the following content
export PATH=$PATH:~/Documents/clingo-4.5.3/

4. To save and exit, click "Shift" + ":" together and type "wq" and press Enter.

Now you're all done.

To ensure you did it right, type:

clingo

Set PYTHONPATH to bashrc [Clingo Python Environment Variable]

1. Open Terminal
2. Type the following Command:

vi ~/.bashrc

3. Add the following content
export PYTHONPATH=~/Documents/clingo-4.5.3-source/build/release/python
export PYTHONPATH=<path-to-gringo-sources>/build/release/python 
        Here, <path-to-gringo-sources> is the path to the gringo sources.

4. To save and exit, click "Shift" + ":" together and type "wq" and press Enter.

Now you're all done.

To ensure you did it right, type:

echo $PYTHONPATH
OR
printenv PYTHONPATH

Friday, November 6, 2015

Remove Folder using Terminal on OpenSUSE

To remove:
1. Open Terminal
2.Type:

sudo rm -r Clang 

[here, if you're not in a current directory, give full path]

Find OpenSUSE Version using Terminal

A quick way to find which version of OpenSUSE you're using:

1. Open Terminal
2. Type:
cat /etc/SuSE-release
That will show you the result.

UPDATE:
/etc/SuSE-release is deprecated and will be removed in the future, use /etc/os-release instead

Thursday, November 5, 2015

Take Screenshot on OpenSUSE

Run the following command:

gnome-screenshot -a

By default, the screenshot will be stored in Pictures folder.

Wednesday, November 4, 2015

Set PYTHONPATH Environment Variable OpenSUSE

1. Open Terminal
2. Type:
 which Python
it will show the path where python is installed.
For example: /usr/bin/python

3. Now, type the following command:

export PYTHONPATH=$PYTHONPATH:/usr/bin/python

4. Now you're all set. Just to make sure, type following command:
printenv | grep PYTHON
or
printenv PYTHONPATH
that should show you :
PYTHONPATH=:/usr/bin/python

if the pythonpath is not set, it shows:
PYTHONPATH=