Wednesday, 26 November 2014

Acer C720 Linux Ubuntu Brightness Keys (ElementaryOS)

This is written for the Acer C720-3445 ("NX.SHEAA.019") running elementary OS Freya beta-1, but it should work for other Acer C720 models and/or other ubuntu-derived flavours.

After installing your favourite flavour of linux on your Acer C720 chromebook, you may notice that the special function keys above the numbers row do not work as anticipated.  These are actually just normal function keys (i.e. "F keys") that you see on a normal keyboard, but instead of being labelled F1, F2, F3... they are labelled with pictures.


You'll notice that you can use them just like normal Function keys.  For example, ALT + F4 (the fullscreen image key) will close a program and F1 (the "back" key) will pull up a Help Menu on most applications.  Getting the volume keys working is pretty straight forward.  The keys that normally control this function are XF86AudioMute XF86AudioLowerVolume and XF86AudioRaiseVolume, but we're going to change them to F8, F9, and F10, respectively.  In elementary OS and other ubuntu 14.04 derivations, this keybindings can be manually set quite easily from the System Settings > Keyboard > Media menu:


Settings the brightness keys is more difficult, since the option for brightness keybindings is not build into the elementary OS or ubuntu settings.  However, this can be accomplished through the custom keybindings settings in org.gnome.settings-daemon.plugins.media-keys custom-keybindings.  The goal is to use a package called xdotool to call the brighness keys behind the scenes.  We'll then bind this process to the F6 and F7 keys on the Acer keyboard.  Here's how it is accomplished:

First, grab the xdotool application.  It should already be accessible from the repositories:
sudo apt-get install xdotool

The keys we want are XF86MonBrightnessDown and XF86MonBrightnessUp.  You can test these commands by opening an terminal and running:
xdotool key XF86MonBrightnessDown
xdotool key XF86MonBrightnessUp

You should see your screen brightness decrease, then increase.  It should also tie in with elementary OS's info window.  Next is to check if you already have any custom keybindings.  Run:
dconf read /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings

It should come back empty.... if not, you've probably already modified it and will need to make sure your current custom keybindings are not deleted.  Next, we will create two keybindings: one for brightness down and another for brightness up.  Let's call them custom1 and custom2, respectively:
gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/','/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/']"

You can check these settings visually with dconf (dconf-tools):


All that's left is to set the name, binding, and command parameters.  Start with brightness down/ F6:
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/ name 'BrightnessDown'

gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/ binding 'F6'

gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/ command 'xdotool key XF86MonBrightnessDown'


And here's brightness up for F7:
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/ name 'BrightnessUp'

gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/ binding 'F7'

gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/ command 'xdotool key XF86MonBrightnessUp'


The keys should work as per the keypad now.  Note that this will likely screw up your native F6 and F7 functions, which was not a problem for me since those keys were never used for anything else.  I also had to restart my computer before the keybindings took affect.




Monday, 10 November 2014

Elementary OS Luna Configuration Script

Elementary OS 'Luna'  rocks!...... BUT, it does need some help out of the box.  Nothing crazy, mostly look & feel improvements, removing programs and adding others.  I'm in the middle of buying a new laptop, and am trying out lots of different installs.  To help save time (and sanity) I wrote a short script to configure Luna the way I want right after install.

Now, it's not perfect.... there may be a few hiccups but it basically turns this:

Pre config script
.
.
. . .into this:
Post config script!

I think it's a lot more polished look, so I'm sharing the script below to help my fellow elementary OS-ers.  

What it does

Uninstalls all these default applications:
  • Midori (default browser) 
  • Software Center (default software management)
  • Scratch (text editor) 
  • ModemManager (does anyone really need this?)
  • Empathy (chat aggregator)
  • Indicator-messages (empathy chat in the toolbar)
  • Maya (default calendar)
  • Geary  (mail app....because, really, nothing beats Gmail in the browser)
  • Shotwell (photos)
  • Totem (video player)
  • Noise (I was going to replace this with Clementine but turns out I like Noise better)
Installs these (better?) applications:
  • Google Chrome
  • Firefox
  • Zotero  (& Qnotero)
  • Dconf tools
  • Gedit (text editor)
  • Gnome Partition Manager
  •  VLC media player
  • Lots of unzip and file packaging utilities
  • Ubuntu Restricted Extras
  • Pinta (image editor... yeah, I like it better than the Gimp)
  • GPicView Image Viewer
  • Elementary Tweaks (this rocks!)
  • a bunch of Elementary Window, Icon & Plank themes
  • Super Wingpanel & Synapse search indicator
  • Skype
  • Libreoffice & dictionaries
  • QBitTorrent
  • Conky
Makes some settings & config changes:
  • Shortens window open/close animation time
  • Reduces window shadows but about 90%
  • Top-left hot corner shows all windows
  • Default "list" in pantheon-files (instead of icons) and default double-click (instead of single)
  • Change Plank icons (smaller) and apply HUD theme
  • Apply elFaenza icon set to everything
  • Configure Conky (a la custom elementary OS conky theme)
  • a few other gedit and terminal settings changes

Some cavetats

  • Some applications need 3rd party repositories.  These REPOSITORIES WILL BE ADDED TO YOUR APPROVED LIST
  • You might need to make some edits to your conky script to get it working properly
  • Super-Wingpanel and Conky might not work correctly until a reboot
  • Many settings can be modified and tweaked via Elementary Tweaks.  Access this from your Settings application menu.

Ok, ok, where's the script?

Download it here or copy the full text below:
#!/bin/bash        

### Written by anjp on 04-November-2014
### http://justplainobvious.blogspot.com
###  
### Download Elementary OS from here:
### http://sourceforge.net/projects/elementaryos/files/stable/
###
### Save this script as Luna_config.sh and run in Terminal "sudo sh Luna_config.sh"


###  Function list
RunWholeScript(){
    while true; do
        read -p "Are you sure? Run with NO USER INPUTS (y/n)???" yn
        case $yn in
            [Yy]* )
                    ### Remove the eOS Junk                  
                    read -p "First is removing eOS default apps.  Press ENTER key to continue..." pause
                    sudo apt-get autoremove --purge midori-granite software-center scratch-text-editor modemmanager empathy indicator-messages maya-calendar geary shotwell totem              
                    echo "Done removing eOS junk apps...\n"
                    ### Add all the new Repos
                    read -p "Next is adding new Repos.  Be patient.  Press ENTER key to continue..." pause
                    sudo add-apt-repository ppa:pinta-maintainers/pinta-stable
                    sudo apt-add-repository ppa:versable/elementary-update
                    sudo add-apt-repository ppa:smathot/cogscinl
                    sudo apt-add-repository "deb http://archive.canonical.com/ubuntu/ precise partner"
                    sudo add-apt-repository ppa:libreoffice/ppa
                    sudo add-apt-repository ppa:git-core/ppa
                    wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
                    sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'                  
                    wget https://raw.github.com/smathot/zotero_installer/master/zotero_installer.sh \    -O /tmp/zotero_installer.sh
                    chmod +x /tmp/zotero_installer.sh                  
                    echo "Done adding Repos...\n"
                    ### Update
                    read -p "Next is an apt-get update.  Press ENTER key to continue..." pause
                    sudo apt-get update
                    echo "Done with update\n"
                    ### Install new software                                      
                    read -p "Next is installing all new software.  Press ENTER key to continue..." pause                  
                    sudo apt-get install google-chrome-stable firefox dconf-tools gedit gedit-plugins gparted vlc unace unrar zip unzip xz-utils p7zip-full p7zip-rar sharutils rar uudeview mpack arj cabextract file-roller ubuntu-restricted-extras pinta gpicview elementary-desktop elementary-tweaks elementary-blue-theme elementary-champagne-theme elementary-colors-theme elementary-dark-theme elementary-harvey-theme elementary-lion-theme elementary-milk-theme elementary-plastico-theme elementary-whit-e-theme elementary-elfaenza-icons elementary-emod-icons elementary-enumix-utouch-icons elementary-nitrux-icons elementary-taprevival-icons elementary-plank-themes super-wingpanel indicator-synapse qnotero skype libreoffice libreoffice-style-human libreoffice-style-oxygen libreoffice-style-crystal libreoffice-style-sifr libreoffice-style-tango libreoffice-style-galaxy libreoffice-pdfimport hyphen-en-us mythes-en-us libreoffice-help-en-us qbittorrent git conky lm-sensors
                    sudo /tmp/zotero_installer.sh
                    sudo rm /tmp/zotero_installer.sh
                    echo "Done installing new software...\n"                                      
                    ### Gala Configs - Window Animations
                    read -p "Next is shortening Window Animations.  Press ENTER key to continue..." pause                                      
                    gsettings set org.pantheon.desktop.gala.animations close-duration 260
                    gsettings set org.pantheon.desktop.gala.animations menu-duration 120
                    gsettings set org.pantheon.desktop.gala.animations minimize-duration 160
                    gsettings set org.pantheon.desktop.gala.animations close-duration 300
                    gsettings set org.pantheon.desktop.gala.animations snap-duration 120
                    gsettings set org.pantheon.desktop.gala.animations close-duration 300
                    echo "Done shortening Window Animations...\n"
                    ### Gala Configs - Change to Windows Min/Max/Close
                    read -p "Next is changing window min/max/close buttons.  Press ENTER key to continue..." pause                                      
                    gsettings set org.pantheon.desktop.gala.appearance button-layout ":minimize,maximize,close"
                    echo "Done changing window buttons...\n"
                    ### Gala Configs - Change Hot Corner Top-Left
                    read -p "Next is changing top left hot corner.  Press ENTER key to continue..." pause                                      
                    gsettings set org.pantheon.desktop.gala.behavior hotcorner-topleft "window-overview"
                    echo "Done changing window buttons...\n"
                    ### Gala Configs - Decreasing Window Shadows
                    read -p "Next is decreasing window shadows .  Press ENTER key to continue..." pause                                      
                    gsettings set org.pantheon.desktop.gala.shadows dialog-focused "['2','-1','0','1','190']"
                    gsettings set org.pantheon.desktop.gala.shadows dialog-unfocused "['2','-1','0','1','130']"
                    gsettings set org.pantheon.desktop.gala.shadows menu "['2','-1','0','1','130']"
                    gsettings set org.pantheon.desktop.gala.shadows normal-focused "['3','-1','0','2','220']"
                    gsettings set org.pantheon.desktop.gala.shadows normal-unfocused "['2','-1','0','2','150']"
                    echo "Done decreasing window shadows...\n"
                    ### Gala Configs - Files LIST VIEW and DOUBLE CLICK
                    read -p "Next is changing Files List View and Double Click.  Press ENTER key to continue..." pause                                      
                    gsettings set org.pantheon.files.preferences default-viewmode "list"
                    gsettings set org.pantheon.files.preferences single-click false
                    echo "Done Gala Files configs ...\n"
                    ### Gedit Configs
                    read -p "Next are gedit formatting configs.  Press ENTER key to continue..." pause                                      
                    gsettings set org.gnome.gedit.preferences.editor auto-indent true
                    gsettings set org.gnome.gedit.preferences.editor display-line-numbers true
                    gsettings set org.gnome.gedit.preferences.editor display-right-margin true
                    gsettings set org.gnome.gedit.preferences.editor wrap-mode none                
                    echo "Done gedit configs...\n"
                    ### Terminal Configs
                    read -p "Next is changing terminal forget tabs upon reload.  Press ENTER key to continue..." pause                                      
                    gsettings set org.pantheon.terminal.settings remember-tabs false                  
                    echo "Done terminal configs...\n"
                    ### Super Wingpanel Configs
                    read -p "Next Super Wingpanel configs.  Press ENTER key to continue..." pause                                      
                    gsettings set org.pantheon.desktop.super-wingpanel enable-slim-mode true
                    gsettings set org.pantheon.desktop.super-wingpanel hide-mode "Intellihide"
                    gsettings set org.pantheon.desktop.super-wingpanel slim-panel-edge "Curved 3"
                    gsettings set org.pantheon.desktop.super-wingpanel slim-panel-separate-launcher true
                    gsettings set org.pantheon.desktop.super-wingpanel slim-panel-margin 64
                    gsettings set org.pantheon.cerbere monitored-processes "['super-wingpanel', 'plank', 'slingshot-launcher --silent']"
                    killall wingpanel & super-wingpanel &        
                    echo "Done super-wingpanel configs...\n"
                 
                    ### Plank
                    read -p "Next is configuring Plank.  Press ENTER key to continue..." pause
                    rm ~/.config/plank/dock1/settings
                    rm ~/.config/plank/dock1/launchers/*                                  
   echo "#This file auto-generated by Plank.
#2014-11-05T04:11:42+0000

[PlankDockPreferences]
#Whether to show only windows of the current workspace.
CurrentWorkspaceOnly=false
#The size of dock icons (in pixels).
IconSize=40
#If 0, the dock won't hide.  If 1, the dock intelligently hides.  If 2, the dock auto-hides. If 3, the dock elementary-hides.
HideMode=3
#Time (in ms) to wait before unhiding the dock.
UnhideDelay=0
#The monitor number for the dock. Use -1 to keep on the primary monitor.
Monitor=-1
#List of *.dockitem files on this dock. DO NOT MODIFY
DockItems=google-chrome-stable.dockitem;;firefox.dockitem;;zotero.desktop;;libreoffice-startcenter.dockitem;;pantheon-files;;switchboard.desktop;;pantheon-terminal.desktop;;gnome-screenshot.desktop
#The position for the dock on the monitor.
Position=3
#The dock's position offset from center (in percent).
Offset=0
#The name of the dock's theme to use.
Theme=HUD
#The alignment for the dock on the monitor's edge.
Alignment=3
#The alignment of the items in this dock.
ItemsAlignment=3" > ~/.config/plank/dock1/settings


echo "[PlankItemsDockItemPreferences]
Launcher=file:///usr/share/applications/google-chrome-stable.desktop" > ~/.config/plank/dock1/launchers/google-chrome-stable.dockitem

echo "[PlankItemsDockItemPreferences]
Launcher=file:///usr/share/applications/firefox.desktop" > ~/.config/plank/dock1/launchers/firefox.dockitem

echo "[PlankItemsDockItemPreferences]
Launcher=file:///usr/share/applications/zotero.desktop" > ~/.config/plank/dock1/launchers/zotero.dockitem

echo "[PlankItemsDockItemPreferences]
Launcher=file:///usr/share/applications/libreoffice-startcenter.desktop" > ~/.config/plank/dock1/launchers/libreoffice-startcenter.dockitem

echo "[PlankItemsDockItemPreferences]
Launcher=file:///usr/share/applications/pantheon-files.desktop" > ~/.config/plank/dock1/launchers/pantheon-files.dockitem

echo "[PlankItemsDockItemPreferences]
Launcher=file:///usr/share/applications/switchboard.desktop" > ~/.config/plank/dock1/launchers/switchboard.dockitem

echo "[PlankItemsDockItemPreferences]
Launcher=file:///usr/share/applications/pantheon-terminal.desktop" > ~/.config/plank/dock1/launchers/pantheon-terminal.dockitem

echo "[PlankItemsDockItemPreferences]
Launcher=file:///usr/share/applications/gnome-screenshot.desktop" > ~/.config/plank/dock1/launchers/gnome-screenshot.dockitem
                    echo "Done Plank configs...\n"
                 
                    ### Conky
                    read -p "Next is configuring Conky.  Press ENTER key to continue..." pause                                      
                    wget http://anjp.comlu.com/scripts/.conkyrc
                    mv  ~/Downloads/.conkyrc ~/
                    wget http://anjp.comlu.com/fonts/Dotmatrx.ttf
                    wget http://anjp.comlu.com/fonts/PIZZADUDEBULLETS.ttf
                    wget http://anjp.comlu.com/fonts/STYLBCC_.TTF
                    wget http://anjp.comlu.com/fonts/openlogos.ttf
                    wget http://anjp.comlu.com/fonts/weather.ttf
                    mkdir ~/.fonts/
                    mv ~/Downloads/Dotmatrx.ttf ~/.fonts/
                    mv ~/Downloads/PIZZADUDEBULLETS.ttf ~/.fonts/
                    mv ~/Downloads/STYLBCC_.TTF ~/.fonts/
                    mv ~/Downloads/openlogos.ttf ~/.fonts/
                    mv ~/Downloads/weather.ttf ~/.fonts/
                    conky &
                    echo "Done ...\n"
                    read -p "Next is telling Conky to autostart.  Press ENTER key to continue..." pause                                      
                    mkdir ~/.config/autostart
echo > "[Desktop Entry]
Type=Application
Exec=conky -p 5
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_CA]=Conky Launcher
Name=Conky
Comment[en_CA]=Conky!
Comment=Conky!" > ~/.config/autostart/Conky
                    echo "Done ...\n"
                 

                    # Change start menu to open with ONLY the Super key, instead of Super + Space
                    # gsettings set org.gnome.desktop.wm.keybindings panel-main-menu "['Super_L','F2']"
                    ### next line to change back ###
                    # gsettings set org.gnome.desktop.wm.keybindings panel-main-menu "['space', 'F2']"

                 
                    #Cleanup
                    sudo apt-get update
                    sudo apt-get upgrade
                    sudo apt-get autoremove
                    sudo apt-get autoclean
                    #All done
                    echo "\nNO USER INPUT script complete!\n"                  
                    read -p "Press ENTER key to exit..." pause            
                    exit;;
            [Nn]* ) break;;
            * ) echo "Please answer yes or no.";;
        esac
    done
}



echo "\n******************************************************"
echo "***********  eOS Luna configuration script  **********"
echo "******************************************************\n"
echo "This script will remove most of the eOS default applications and install more commonly used ones\n"
echo "See 'Luna_config.sh' for more info"
echo "Press CTRL + C at any time to exit...\n"
read -p "Press ENTER key to start..." pause


#### Option to just do everything without step-by-step
while true; do
    read -p "Do you just want to run the entire script WITH NO USER INPUTS (y/n)?" yn
    case $yn in
        [Yy]* )
                RunWholeScript
                break;;
        [Nn]* ) break;;
        * ) echo "Please answer yes or no.";;
    esac
done

### Starting user-input script
echo "\nStarting script with user input...\n"
echo "\n  Sorry, I got lazy and decided only to write the NO USER INPUT part!"
read -p "Press ENTER key to exit..." pause

Now just run the script in a terminal and follow the prompts:
sudo sh Luna_config.sh

I'm sure there will be some hiccups... post questions below and let me know what you did with all your time savings!


Sunday, 9 November 2014

Elementary OS Conky Theme (Script)

Update: You can get this script and more desktop customizations through a new Freya Config script here.

In the last month or so I've switched over to elementary OS Luna (I've tried the Freya beta as well, but it's still not polished enough for my every day work laptop).  The switch to elementary OS necessitated a good conky theme.

Below are light theme (blue/grey) and dark theme (orange/black) options for a nice simple conky script that displays all the info I want at any time.  The main formatting and icons were taken from the vinDSL theme, but I removed the weather, calendar, and fancy lua bars.  I wanted this conky script to be lightweight and easy on the eyes.

Elementary OS "Light" conky theme:

Conky Desktop (light theme)

Elementary OS "Dark" conky theme:

Conky Desktop (dark theme)


The first thing you need is conky itself and lm-sensors (for HD + GPU info):
sudo apt-get install conky lm-sensors

You might also need to run the following command to allow conky permission to pull wireless data:
sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/conky

Now it's a simple matter of grabbing the conky script (light theme here, dark theme here) and saving it as ".conkyrc" in your home folder. You will also need to grab the DotMatrix, PizzaDude, OpenLogos, and StyleBats icon font sets and place them in your ~/.fonts folder.  You can do this by executing:
wget http://anjp.comlu.com/fonts/Dotmatrx.ttf
wget http://anjp.comlu.com/fonts/PIZZADUDEBULLETS.ttf
wget http://anjp.comlu.com/fonts/STYLBCC_.TTF
wget http://anjp.comlu.com/fonts/openlogos.ttf
wget http://anjp.comlu.com/fonts/weather.ttf
mkdir ~/.fonts/
mv ~/Downloads/Dotmatrx.ttf ~/.fonts/
mv ~/Downloads/PIZZADUDEBULLETS.ttf ~/.fonts/
mv ~/Downloads/STYLBCC_.TTF ~/.fonts/
mv ~/Downloads/openlogos.ttf ~/.fonts/
mv ~/Downloads/weather.ttf ~/.fonts/

You can run conky anytime by executing:
conky

If you made a mistake or need to close conky, it can be stopped using:
killall conky

NOTE #1: This conky config looks like a desktop panel but just runs on the desktop. If you want it to act as a panel, change the variable 'own_window_type' from 'desktop' to 'panel' and remove 'undecorated' from own_window_hints

NOTE #2: Most of the variables are dynamic, but a few at the top info area (hardware model, gpu model) are hardcoded. Others (processor type) truncate at certain string lengths and may need some tlc

Here's the full 'light theme' code:
####
## Prerequisites (required)
#
#  conky-all 1.8.0 or 1.8.1-5
#  cURL - Command Line Tool
#  xsltproc - Command Line Tool
#  UTF-8 Compatible Text Editor
#
## Tips n' Tricks
## Several ppl (including myself) have experienced issues with conky-all 1.8.1-6
## In every instance, downgrading to conky-all 1.8.1-5 has solved the problem(s).
## I recommend using (and pinning) conky-all 1.8.1-5 until things get sorted.
## conky-all 1.8.1-5 can be downloaded here: https://launchpad.net/ubuntu/+source/conky-all/1.8.1-5

####
## Installed fonts (required)
#
#  ConkyWeather (Stanko Metodiev)
#  Cut Outs for 3D FX (Fonts & Things)
#  Droid Font Family (Google Android SDK)
#  KR A Round (Kat's Fun Fonts)
#  OpenLogos (Icoma)
#  PizzaDude Bullets (Jakob Fischer)
#  Radio Space (Iconian Fonts)
#  StyleBats (Vinterstille)
#  Ubuntu Font Family (Canonical Ltd)
#  Ubuntu Title Bold (Paulo Silva - not included in link below)
#  Weather (Jonathan Macagba)
#
## Tips n' Tricks from Mr. Peachy, djyoung4, and 42dorian (Thanks!)
## Most necessary fonts can be downloaded here: http://ompldr.org/vOHdoag
## Unzip the fonts into your font folder, for example: /home/username/.fonts
## Run this command in a terminal (rebuilds font cache file): sudo fc-cache -fv

####
## Use XFT? Required to Force UTF8 (see below)
#
use_xft yes
xftfont DroidSans:size=8
xftalpha 0.1

####
## Force UTF8? Requires XFT (see above)
## Displays degree symbol, instead of °, etc.
#
override_utf8_locale yes

####
## This buffer is used for text, single lines, output from $exec, and other variables.
## Increasing the text buffer size (too high) will drastically reduce Conky's performance.
## Decreasing the size (too low) will truncate content and cause strange display output.
## Standard text buffer size is 256 bytes (cannot be less). Adjust YOUR buffer wisely!
#
text_buffer_size 640

####
## Daemonize Conky, aka 'fork to background'.
#
background yes

####
## Update interval in seconds.
#
update_interval 2.0

####
## The number of times Conky will update before quitting.
## Zero makes Conky run forever.
#
total_run_times 0

####
## Create own window in instead of using desktop?
#
own_window yes
own_window_transparent no
own_window_type desktop    ## (panel or desktop)
own_window_class conky-semi
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

####
## Background color IF own_window_transparent set to "no"
own_window_colour 323232          ######## Default background color

####
## Some distros also require the following 2 lines.
#
own_window_argb_visual yes
own_window_argb_value 160     # 0 - 255 where 255 is opaque

####
## Force images to redraw when they change.
#
imlib_cache_size 0
255255
####
## Use double buffering? Reduces flicker.
#
double_buffer yes

####
## Draw shades?
#
draw_shades yes
default_shade_color 292421  

####
## Draw outlines?
#
draw_outline no

####
## Draw borders around text?
#
draw_borders no

####
## Draw borders around graphs?
#
draw_graph_borders no

####
## Print text to stdout?
## Print text in console?
#
out_to_ncurses no
out_to_console no

####
## Text alignment.
#
alignment top_right

####
## Minimum size of the text area.
## Syntax: minimum_size [width] [height]
#
minimum_size 200 1200

####
## Maximum width of the text area.
## Syntax: maximum_width [width]
#
maximum_width 200

####
## Gap between text and screen borders.
#
gap_x 6  ## Left / Right
gap_y 2  ## Top / Bottom

####
## Shorten MiB/GiB to M/G in stats.
#
short_units yes

####
## Pad % symbol spacing after numbers.
#
pad_percents 0

####
## Pad spacing between text and borders.
#
border_inner_margin 4

####
## Limit the length of names in "Top Processes".
#
top_name_width 10

####
## Subtract file system -/+buffers/cache from used memory?
## Set to yes, to produce meaningful physical memory stats.
#
no_buffers yes

####
## Set to yes, if you want all text to be in UPPERCASE.
#
uppercase no

####
## Number of cpu samples to average.
## Set to 1 to disable averaging.
#
cpu_avg_samples 2

####
## Number of net samples to average.
## Set to 1 to disable averaging.
#
net_avg_samples 2

####
## Add spaces to keep things from moving around?
## Only affects certain objects.
#
use_spacer right

####
## My colors (suit yourself)
#
color0 White #FFFFFF    ---
color1 6b6b6b #6b6b6b    Icons
color2 6b6b6b #323232    System/Processors/Mem/HD text
color3 Ivory3 #CDCDC1    Text
color4 6db9d5 #6db9d5   Headings
color5 Tan2 #EE9A49    ---
color6 323232 #323232    PizzaDude Icons
color7 323232     #323232    Processes Icons
color8 323232 #323232    Heading Lines
color9 6b6b6b #6b6b6b    BarGraphs


#### Color Schemes
#
# elementary bkgnd = f5f5f5
# elementary grey  = d3d3d3
# dark grey        = 323232
# lighter grey     = 6b6b6b or a4a4a4
# light blue       = 6db9d5
#
####


TEXT
##################################
##             LOGO             ##
##################################
${voffset 36}${font RadioSpace:size=14}${color3}${alignc}${uid_name 1000}@${nodename}${font}
${voffset 3}${font DroidSans:size=8.6}${color3}${alignc}HP Pavilion dv6428ca
##################################
##            SYSTEM            ##
##################################
${voffset 7}${font DroidSans:bold:size=8.25}${color4}SYSTEM${offset 8}${color8}${voffset -2}${hr 2}${font}
${voffset 4}${font OpenLogos:size=10}${color2}u${voffset -4}${font DroidSans:size=8.6}${color3}${offset 5}${pre_exec lsb_release -sd || cat /etc/*release}${alignr}${pre_exec lsb_release -r | cut -f 2| tr "[:upper:]" "[:lower:]"}${font}
${voffset 2}${offset -2}${font OpenLogos:size=12}${color2}Z${voffset -4}${font DroidSans:size=8.6}${color3}${offset 3}${sysname}${offset 3}${kernel}${alignr}${font DroidSans:size=8.3}${machine}${font}
${voffset 2}${font StyleBats:size=10}${color2}d${voffset -2}${font DroidSans:size=8.6}${color3}${offset 5}nVidia GeForce 6150 G0${alignr}${font DroidSans:size=8.3}${execi 60 nvidia-settings -query GPUCoreTemp | perl -ne 'print $1 if /GPUCoreTemp.*?: (\d+)./;'} °C
${voffset 2}${font StyleBats:size=10}${color2}A${voffset -1}${font DroidSans:size=8.6}${color3}${offset 5}${execi 1000 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq | cut -c 1-20}${alignr 1}${font DroidSans:size=8.3}${freq_g cpu0}${offset 1}GHz${font}
${voffset 2}${font StyleBats:size=10}${color2}q${voffset -1}${font DroidSans:size=8.6}${color3}${offset 5}System${offset 3}Uptime${alignr}${font DroidSans:size=8.3}${uptime_short}${font}
##################################
##          PROCESSORS          ##
##################################
${voffset 8}${font DroidSans:bold:size=8}${color4}PROCESSORS${offset 8}${color8}${voffset -2}${hr 2}${font}
${voffset 4}${font StyleBats:size=9.9}${color2}k${voffset -2}${font DroidSansFallback:size=8.39}${color3}${offset 2}CPU1${offset 5}${font DroidSans:size=8.3}${cpu cpu1}%${font}${color9}${alignr}${cpubar cpu1 6,120}
${voffset 2}${font StyleBats:size=9.9}${color2}k${voffset -2}${font DroidSansFallback:size=8.39}${color3}${offset 2}CPU2${offset 5}${font DroidSans:size=8.3}${cpu cpu2}%${font}${color9}${alignr}${cpubar cpu2 6,120}
${voffset 2}${font DroidSansFallback:size=8.39}${color3}${offset 4}Load  ${loadavg}${alignr}(${execi 5 cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor})
##################################
##            MEMORY            ##
##################################
${voffset 8}${font DroidSans:bold:size=8}${color4}MEMORY${offset 8}${color8}${voffset -2}${hr 2}${font}
${voffset 4}${font StyleBats:size=10}${color2}l${voffset -2}${font DroidSansFallback:size=8.3}${color3}${offset 3}RAM${goto 97}${font DroidSans:size=8.3}${mem}${goto 133}/${offset 5}${memmax}${alignr}${memperc}%${font}
${voffset 2}${font}${color9}${alignc}${membar 6,194}
##################################
##             HDD              ##
##################################
${voffset 8}${font DroidSans:bold:size=8}${color4}HDD${offset 8}${color8}${voffset -2}${hr 2}${font}
${voffset 6}${font StyleBats:size=9.9}${color2}x${voffset -2}${font DroidSansFallback:size=8.3}${color3}${offset 4}Root${goto 95}${font DroidSans:size=8.3}${fs_used /}${goto 133}/${offset 5}${fs_size /}${alignr}${fs_used_perc /}%${font}
${color9}${voffset 2}${alignc}${fs_bar 6,194}
${voffset 6}${font StyleBats:size=9.9}${color2}4${voffset -2}${font DroidSansFallback:size=8.3}${color3}${offset 4}Swap${goto 95}${font DroidSans:size=8.3}${swap}${goto 133}/${offset 5}${swapmax}${alignr}${swapperc}%${font}
${color9}${voffset 2}${alignc}${swapbar 6,194}
##################################
##             TIME             ##
##################################
${voffset 8}${font DroidSans:bold:size=8}${color4}TIME${offset 8}${color8}${voffset -2}${hr 2}${font}
${voffset -4}${font RadioSpace:size=32}${color3}${if_match ${time %l}<=9}${alignc 7}${time %H:%M}${else}${if_match ${time %l}>=10}${alignc -1}${time %H:%M}${endif}${endif}${font}
${voffset 2}${color3}${alignc}${time %A, %d %b %Y}
##################################
##         TOP PROCESSES        ##
##################################
${voffset 8}${font DroidSans:bold:size=8}${color4}TOP PROCESSES${offset 8}${color8}${voffset -2}${hr 2}${font}
${voffset 6}${font StyleBats:size=10}${color7}h${voffset -1}${font DroidSans:size=8.65}${color3}${offset 5}${top_mem name 1}${goto 120}${font DroidSans:size=8.3}${top_mem mem_res 1}${alignr}${top_mem mem 1}%${font}
${voffset 1}${font StyleBats:size=10}${color7}h${voffset -1}${font DroidSans:size=8.65}${color3}${offset 5}${top_mem name 2}${goto 120}${font DroidSans:size=8.3}${top_mem mem_res 2}${alignr}${top_mem mem 2}%${font}
${voffset 1}${font StyleBats:size=10}${color7}h${voffset -1}${font DroidSans:size=8.65}${color3}${offset 5}${top_mem name 3}${goto 120}${font DroidSans:size=8.3}${top_mem mem_res 3}${alignr}${top_mem mem 3}%${font}
${voffset 1}${font StyleBats:size=10}${color7}h${voffset -1}${font DroidSans:size=8.65}${color3}${offset 5}${top_mem name 4}${goto 120}${font DroidSans:size=8.3}${top_mem mem_res 4}${alignr}${top_mem mem 4}%${font}
${voffset 1}${font StyleBats:size=10}${color7}h${voffset -1}${font DroidSans:size=8.65}${color3}${offset 5}${top_mem name 5}${goto 120}${font DroidSans:size=8.3}${top_mem mem_res 5}${alignr}${top_mem mem 5}%${font}
# ${voffset 1}${font StyleBats:size=10}${color7}h${voffset -1}${font DroidSans:size=8.65}${color3}${offset 5}${top_mem name 6}${goto 120}${font DroidSans:size=8.3}${top_mem mem_res 6}${alignr}${top_mem mem 6}%${font}
##################################
##           NETWORK            ##
##################################
${voffset 8}${font DroidSans:bold:size=8}${color4}NETWORK${offset 8}${color8}${voffset -2}${hr 2}${font}
${voffset 4}${font StyleBats:size=10}${color6}l${font}${font DroidSans:size=8.65}${color3}${offset 5}SSID ${alignr}${wireless_essid eth1} @ ${wireless_bitrate eth1}
${voffset 0}${font PizzaDude Bullets:size=9.5}${color6}Z${font}${font DroidSans:size=8.65}${color3}${offset 5}Strength${font}${color9}${alignr}${wireless_link_bar 6,88 eth1}
${voffset 4}${font PizzaDudeBullets:size=9.5}${color6}T${font DroidSans:size=8.65}${color3}${offset 5}Download${goto 120}${font DroidSans:size=8.3}${totaldown eth1}${alignr}${font DroidSans:size=8.3}${downspeed eth1}${font}
${voffset 0}${font PizzaDudeBullets:size=9.5}${color6}N${font DroidSans:size=8.65}${color3}${offset 5}Upload${goto 120}${font DroidSans:size=8.3}${totalup eth1}${alignr}${font DroidSans:size=8.3}${upspeed eth1}${font}
${voffset 4}${font PizzaDudeBullets:size=9.5}${color6}a${font DroidSans:size=8.65}${color3}${offset 5}Private${offset 3}IP${goto 123}${alignr}${font DroidSans:size=8.3}${addr eth1}${font}
${voffset 0}${font PizzaDudeBullets:size=9.5}${color6}a${font DroidSans:size=8.65}${color3}${offset 5}Public${offset 7}IP${goto 121}${alignr}${font DroidSans:size=8.3}${execi 1800 wget -q -O - checkip.dyndns.org | sed -e 's/[^[:digit:]\|.]//g'}${font}
###
### Some of the wireless commands require the following command to be run in terminal (one-time) before they work: (it's a permissions issue)
### sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/conky


#################################
##             END             ##
#################################


Did this script work for you?  Did you add any other variables to monitor?  Share in the comments below...

Tuesday, 23 September 2014

Elementary OS Fixes (shell script)

I'm really enjoying ElementaryOS Luna.  It's lightweight, fast, and easy on the eyes.  In fact, I'm running it on an old notebook right now but the plan is to throw it on an Acer C720 chromebook and run it instead of Chrome OS.  But it's not 100% turnkey (I'd say 90%, which is awesome).  The only thing I really felt had to be changed pronto was the uninstalling of some default software (and the installing of better replacement applications).   For example, the default browser is Midori.  Sure, it's ok.. but I'm entrenched into Google Chrome.  Same thing with Totem, Geary, and Empathy....there are just better applications out there.

So here's a bash script that uninstalls all the junk and replaces it with awesome programs!  You can run it as a script or just run each line.  Note that this is a modification of memoryleakx's original script here.

#Download Elementary OS from here:
#http://sourceforge.net/projects/elementaryos/files/stable/

#First you update your system
sudo apt-get update && sudo apt-get dist-upgrade

#Install Google Chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable

#####If you prefer Firefox
#Install Firefox
#sudo apt-get install firefox

#Clean-up System (remove unnecessary ElementaryOS software)
sudo apt-get purge midori-granite
sudo apt-get purge noise
sudo apt-get purge software-center
sudo apt-get purge scratch-text-editor
sudo apt-get purge bluez
sudo apt-get purge modemmanager
sudo apt-get purge empathy
sudo apt-get remove --purge indicator-messages
sudo apt-get purge maya-calendar
sudo apt-get purge geary
sudo apt-get purge shotwell
sudo apt-get purge totem

sudo apt-get autoremove
sudo apt-get autoclean

#Install gedit (Text Editor)
sudo apt-get install gedit gedit-plugins

# Install VLC
sudo apt-get install vlc

#Install File Compression Libs
sudo apt-get install unace unrar zip unzip xz-utils p7zip-full p7zip-rar sharutils rar uudeview mpack arj cabextract file-roller

#Install Ubuntu Restricted Extras
sudo apt-get install ubuntu-restricted-extras

# Install Pinta Photo Editor
sudo add-apt-repository ppa:pinta-maintainers/pinta-stable
sudo apt-get update
sudo apt-get install pinta

# Install Image Viewer
 sudo apt-get install gpicview

#Install Elementary OS extras
sudo apt-add-repository ppa:versable/elementary-update
sudo apt-get update
 ## Elementary Tweaks (System prefs)
sudo apt-get install elementary-desktop elementary-tweaks
## Elementary Themes
sudo apt-get install elementary-blue-theme elementary-champagne-theme elementary-colors-theme elementary-dark-theme elementary-harvey-theme elementary-lion-theme elementary-milk-theme elementary-plastico-theme elementary-whit-e-theme
## Elementary Icons
sudo apt-get install elementary-elfaenza-icons elementary-emod-icons elementary-enumix-utouch-icons elementary-nitrux-icons elementary-taprevival-icons
## Plank Themes
sudo apt-get install elementary-plank-themes
## Wingpanel Slim && Super Wingpanel
sudo apt-get install wingpanel-slim indicator-synapse
sudo apt-get install super-wingpanel

###################
#if not installed
#Install the Dynamic Kernel Module Support Framework
##### sudo apt-get install dkms
##### mkdir kernel
##### cd kernel
####################

#Install Kernel 3.12.2 on 32 Bit
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.12.2-trusty/linux-headers-3.12.2-031202-generic_3.12.2-031202.201311291538_i386.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.12.2-trusty/linux-headers-3.12.2-031202_3.12.2-031202.201311291538_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.12.2-trusty/linux-image-3.12.2-031202-generic_3.12.2-031202.201311291538_i386.deb

sudo dpkg -i *.deb

cd ..
rm -rf kernel
#Reboot!

# Install Zotero for Linux
wget https://raw.github.com/smathot/zotero_installer/master/zotero_installer.sh \    -O /tmp/zotero_installer.sh
chmod +x /tmp/zotero_installer.sh
sudo /tmp/zotero_installer.sh

#Install Qnotero for Linux (Zotero toolbar companion)
sudo add-apt-repository ppa:smathot/cogscinl
sudo apt-get update
sudo apt-get install qnotero

### Don't forget to install the ZotFile plugin manually from www.zotfile.com

#### Install some Handy Indicator Applets ####
#Install CPU Freq Indicator
sudo apt-get install indicator-cpufreq
### copy icon files to elementary theme pack
sudo cp /usr/share/icons/ubuntu-mono-dark/status/22/indicator-cpufreq* /usr/share/icons/elementary/status/22/
sudo gtk-update-icon-cache -f /usr/share/icons/elementary
killall super-wingpanel
#Install Multiload Indicator
sudo apt-get install indicator-multiload
#Install Weather Indicator
sudo apt-get install weather-indicator

#Install Skype
sudo apt-add-repository "deb http://archive.canonical.com/ubuntu/ precise partner"
sudo apt-get update && sudo apt-get install skype

#Install Libre Office (most recent)
sudo add-apt-repository ppa:libreoffice/ppa
sudo apt-get update
sudo apt-get install libreoffice
#Install LibreOffice themes
sudo apt-get install libreoffice-style-human libreoffice-style-oxygen libreoffice-style-crystal libreoffice-style-sifr libreoffice-style-tango libreoffice-style-galaxy
#Install PDF editing
sudo apt-get install libreoffice-pdfimport
##Install Support for US English
sudo apt-get install hyphen-en-us mythes-en-us libreoffice-help-en-us

##Install Support for UK English
sudo apt-get install libreoffice-help-en-gb libreoffice-l10n-en-gb myspell-en-gb hunspell-dictionary-en-gb myspell-dictionary-en-gb hyphen-en-gb libreoffice-grammarcheck-en-gb mythes-en-gb

#Remove extra LibreOffice icons from Slingshot Start Menu (leaves only main 'LibreOffice')
cd /usr/share/applications
sudo rm libreoffice-base.desktop libreoffice-draw.desktop libreoffice-impress.desktop libreoffice-writer.desktop libreoffice-calc.desktop libreoffice-math.desktop

#Install the Clementine Music Player
sudo add-apt-repository ppa:me-davidsansome/clementine
sudo apt-get update
sudo apt-get install clementine

#Install the latest git Version
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install git

# Change start menu to open with ONLY the Super key, instead of Super + Space
gsettings set org.gnome.desktop.wm.keybindings panel-main-menu "['Super_L','F2']"
### to change back
# gsettings set org.gnome.desktop.wm.keybindings panel-main-menu "['space', 'F2']"

#Make sure everything is up to date all over again
sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove
sudo apt-get autoclean


Let me know if you think I missed some anything awesome that should be added to eOS. Happy customising!

Monday, 28 April 2014

How to Fix Netflix (Google) DNS on Roku Update

This post will show you how to fix the Netflix's hardcoded Google DNS on the Roku.

Roku rolled out an update sometime in the last week in which the Netflix application switched from using global DNS settings to hardcoded 8.8.8.8 Google DNS settings.  I have nothing against Google DNS, but I need to use custom settings because I use Unblock-Us to trick Netflix into giving me USA content....and I'm in Canada.   My Roku is currently on version 5.4 build 3340.

Now, Roku is the only network device in my home that does not allow custom DNS settings.... but that's a different complaint for a different post.  Suffice to say that to trick any application on the Roku, custom DNS must be configured at the router level.

I'm going to outline 2 different router-level methods for fixing the Netflix hardcoded DNS: (1) Rerouting 8.8.8.8 to your gateway, and (2) outright blocking any communication with 8.8.8.8

Method 1 - Rerouting to your Gateway

The first step is to log in to your router.  If you don't know how to do that, stop reading and call your go-to tech support family member.  If you're feeling adventurous, see How to Find Your Router's IP Address.  Save the router's address for the configuration we're doing below.

In this example I'm using an old TRENDNET TEW-432BRP with local ip 192.168.10.1

Find your Routing Table settings.  In mine, it's under Routing > Static.  We're going to create a new static route so that every time the Roku (or any network device) looks for 8.8.8.8, it will be automatically directed to the 192.168.10.1 router ip.  As long as the 192.168.10.1 router is configured for custom DNS, it's bye-bye 8.8.8.8.  Enter the following settings:

Network Address: 8.8.8.8
Network Mask: 255.255.255.255
Gateway Address: 192.168.10.1 (router IP)
Interface: LAN
Metric: 2

Make sure you add & enable the route and that's it.




Method 2 - Blocking Google DNS

Get to your router's configuration page as per Method 1, and find your IP Filter configuration settings. On my TRENDNET, it's under Access > Filter > IP Filter.  Now, simply add the range 8.8.8.8 to 8.8.8.8 (the lone IP address) and enable the filter.  Now, all traffic trying to reach 8.8.8.8 will be blocked and timeout.  In the case of Roku's Netflix, it will timeout and default to the global DNS settings.



How to find Your Router's IP Address in Windows

This post explains how to find the IP address of your wireless or wired router.  In my case, this takes place on Windows 7, but it will also for for Windows XP, Windows Vista, etc.

Step 1 - Command Prompt

From the start menu, run the application Command Prompt or just search for "cmd"



Step 2 - Ipconfig

Type the following code and press enter.
ipconfig

Write down the default gateway IP address.  In my case below, I am connecting over WLAN (wireless) and my router default gateway address is 192.168.10.1



Step 3 - Browser


Launch your favourite browser and type the router (gateway) IP in the address bar and hit Enter.
192.168.10.1

You are now at your router's landing page and ready to configure.  Your router might need a password (usually "admin" / "admin")

  © Blogger template 'Isolation' by Ourblogtemplates.com 2008

Back to TOP