Tuesday, October 29, 2019

XFCE: Set Keyboard Layout and Disable Caps Locks


Usually set my keyboard layout and configuration by editing the file: /etc/default/keyboard, like this:

XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT="alt-intl"
XKBOPTIONS="ctrl:nocaps"
BACKSPACE="guess"


But, and I really don't know why, this time on Buster it didn't work.
So, time for a Plan B... I had to do it using setxkbmap and setting it up thru Settings > Session and Startup > Application AutoStart and adding two entries, one for the language and other for the Caps Locks.
The entries look like this:

/usr/bin/setxkbmap -layout us -variant intl
/usr/bin/setxkbmap -option ctrl:nocaps

Labels: , , , , , ,

Tuesday, March 20, 2018

A New Keyboard On The Block


Spotted this the other day that went looking around computer stores around Bs. As.
It looks like HP is dumping the dreadful Spanish keyboard layout and somehow shoehorning it onto the US one.

Labels: , , ,

Monday, December 25, 2017

Switch The Command with The Option Key

Damn! I've spent hours and hours researching how to fix this... And the answer is so damn simple!

Ever since I've started to use the little MacBook Pro, I was desperate with the placement of the Command (Super or Windows) key and the Option (Alt) key on it's lovely and sturdy keyboard, it turns out that on Apple is inverted compared to my Thinkpads and my Happy Hacking keyboard, so, muscle memory and all, and I was about to cut my fingers.

I've tried every trick, snippet and configuration option and recipe that both setxkbmp and xmodmap had in store, to no avail...

But the solution is as simple as executing this on a sudo su - Terminal:

echo "1" > /sys/module/hid_apple/parameters/swap_opt_cmd

That line changes everything and makes the little aluminum lappie completely and totally usable.

Labels: , , , , , ,

Wednesday, August 23, 2017

LXDE Woes


I've been using a bit of tiny Lubuntu install on the small Dell XPS M1330 for the last week or so.
Things have been pretty much Ok with it, but there are a couple of things, small annoyances really, but annoyances nevertheless...

1- Emacs keybindings:
You can't setup global Emacs keybindings on LXDE.
You can, however, add this:

gtk-key-theme-name=Emacs

To the "~/.config/gtk-3.0/settings.ini" file.

2- Circle thru Desktop Pager on LXPanel:
I can't for the life of me, find a way to circle thru virtual desktops on the Desktop Pager, that is, when I reach the end of the desktops, I can't go back to the first one without going thru the previous ones.

No big deals, maybe... Maybe, yeah, but to me the lack of Emacs keybindings it is a major PITA, actually.

Labels: , , , , , , , , ,

Wednesday, June 21, 2017

The Flapping Nine


A little trouble with the magnificent T420 keyboard.
Of course the key works, but its a PITA to use.
Will have to replace or fix that somehow PRONTO.

Labels: , , , , ,

Monday, December 05, 2016

Disble CAPS LOCK on Lubuntu

I did it before, yes... But things have changed, so... Here goes the update.
Edit the file:

~/.config/lxsession/Lubuntu/autostart

And add this:

setxkbmap -option ctrl:nocaps

Logout and back in to test how it works.

Labels: , , , , ,

Tuesday, June 14, 2016

The DOT Emacs file from Xenial Xerus

;; ---------------------------------------------------
;; ~/.emacs default file
;; ---------------------------------------------------

;; -----------------------------------------------
;; Safe defaults

(setq inhibit-startup-message t)
(setq default-major-mode 'text-mode)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; This doesn't work on Emacs 24 ;; 
;; (menu-bar-mode nil)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(menu-bar-mode -1)
(setq bell-volume 100)
(setq visible-bell t)

;; -----------------------------------------------
;; Modeline customization

(display-time)
(setq line-number-mode t)
(setq column-number-mode t)

;; -----------------------------------------------
;; Keyboards shortcuts

(define-key global-map "\C-h" 'backward-delete-char)
(define-key global-map "\M-h" 'backward-kill-word)
(define-key global-map "\C-x\C-u" 'undo)

(global-set-key [f5] 'bury-buffer)

;; (pc-selection-mode)

;; Esc + the arrow keys as a way to delete words
(define-key esc-map [right] 'kill-word)         ;; esc -> kill-word
(define-key esc-map [left] 'backward-kill-word) ;; esc <- backward-kill-word="" br="">
;; -----------------------------------------------

;; Backups

(defun make-backup-file-name (file-name)
  "Create the non-numeric backup file name for `file-name'."
  (require 'dired)
  (if (file-exists-p "~/emacs/backups")
      (concat (expand-file-name "~/emacs/backups/")
      (dired-replace-in-string "/" "|" file-name))
      (concat file-name "~")))

;; -----------------------------------------------
;; Turn on color syntax
(global-font-lock-mode t)

;; -----------------------------------------------
;; Insert timestamp
(defvar insert-time-format "%T")

(defvar insert-date-format "%d %m %Y"
  "*Format for \\[insert-date] (c.f. 'format-time-string' for how to format).")

(defun iTime ()
  (interactive "*")
  (insert (format-time-string insert-time-format
                                    (current-time))))
(defun iDate ()
  (interactive "*")
  (insert (format-time-string insert-date-format
                                    (current-time))))
(defun iDate ()
  (interactive "*")
  (insert (format-time-string insert-date-format
                                    (current-time))))
(defun iDateTotal ()
  (interactive "*")
  (progn
    (iDate)
    (insert " ")
    (iTime)))

;; -----------------------------------------------

;; Abreviaciones ;;
(setq-default abbrev-mode t)
(read-abbrev-file "~/emacs/definiciones_abreviaciones.txt")
(setq save-abbrevs t)

;; Returns the cursor point to the beginning of the abrev
;; De: http://arstechnica.infopop.net/OpenTopic/page?a=tpc&s=50009562&f=96509133&m=1050920535
(defun abr-back ()
   "move abbrev cursor position back to [/"
   (search-backward "[/")
   (put no-self-insert t)
)

;; -----------------------------------------------
;; Turn on color syntax ;;
(global-font-lock-mode t)

;; -----------------------------------------------
;; Loads the path to the installed lisp programs ;;
(setq load-path (cons  "~/emacs/lisp/" load-path))

(require 'blinking-cursor)
(blinking-cursor-mode 1)
(setq blinking-cursor-colors [\"gold\" \"blue\"])

;; Artist.el - Allows to draw using ASCII art
(autoload 'artist-mode "artist" "Enter artist-mode" t)

;; Setnu - Adds line numbering
(autoload 'setnu-mode  "setnu" "Buffer Line Numbering" t)
(defun turn-on-setnu-mode ())

;; IOS mode - Useful to edit Cisco configuration files
;; http://nibrahim.net.in/software/
(autoload 'ios-config-mode "ios-config-mode" "Enter IOS-mode" t)

;; HTML Helper mode
(autoload 'html-helper-mode "html-helper-mode" "Yay HTML" t)
(setq auto-mode-alist (cons '("\\.html$" . html-helper-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("\\.htm$" . html-helper-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("\\.php$" . html-helper-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("\\.vxml$" . html-helper-mode) auto-mode-alist))

;; Adds an HTML template
(setq html-helper-build-new-buffer t)

;; Adds HTML syntax color, uses "html-font.el"
(add-hook 'html-helper-load-hook '(lambda () (require 'html-font)))
(add-hook 'html-helper-mode-hook '(lambda () (font-lock-mode 1)))

(setq html-helper-do-write-file-hooks t)

;; -----------------------------------------------

;; EoF ;;

Labels: , , , , ,

Saturday, September 06, 2014

XFCE: Disable CAPS Lock (and make it a Ctrl)

Kill the most useless key on your keyboard, and at the same time, put it to work doing something useful.

Settings > Session and Startup > Add

Then add the command, a name and a description.
It will start automatically upon login onto your XFCE desktop.

Labels: , , , ,

Sunday, August 10, 2014

Emacs key kindings on XFCE


Can't live without my Emacs keyboard shortcuts, can't even use a box to type my name if they aren't set...
This is what I had to do to set them on XFCE:

Settings > Settings Editor

Select the Channel called xsettings
Select any item on Gtk, and then click on New, and enter the values as on the screenshot.



That is, a new string, with the value Emacs, it is very important to type:
KeyThemeName

After the "/Gtk/" bit on the Property box.



Labels: , , , , ,

Wednesday, June 11, 2014

MATE: Set global Emacs key bindings

This is by far (well maybe the cursor shape customization goes head to head with this...) that I have to setup no matter what on any box I get my hands on...
But, it seems like the new MATE version doesn't honour the way I've set this up on the previous Linux Mint LTS.
On Linux Mint 17, running MATE (duh!) I've used this:

gsettings set org.mate.interface gtk-key-theme "Emacs"




Labels: , , , , , ,

Friday, May 02, 2014

Ubuntu 14.04 on the Thinkpad T60p

Still not my cup of tea

Installed Ubuntu 14.04 LTS (32 bits) on the T60p today, using a SSD drive (I can't even believe there is a new LTS available... Time fucking flies...)

As expected, everything went peachy, no problems at all (Screen resolution, WiFi, Suspend/ Resume, etc, etc, etc...).
Unity feels quite snappy, the border-less windows (on top of the anti-aliased round cornered windows) look truly amazing, but the damn Global Menu implementation still sucks ass big time...

Also, with this current minimalist trend going on that strips everything of every possible configuration option, this Ubuntu release, following GNOME's "directive", doesn't offer any way to edit the keyboard layout (you know, for stuff like remapping the totally useless CapsLock key to a completely more useful additional Ctrl...)
You'll need to install GNOME Tweak Tool in order to do that, the program had a transparent window on the T60p, but I'm pretty sure that's because of the now crappy laptop video card.

Anyways, the thing is not for me, if I can't have the perfect Global Menu, then I don't want any... In the mean time, I'm patiently waiting for Linux Mint's next release, specially with all the annoyances I'm having with my current install.

Next distro hop: the newer Lubuntu.

Labels: , , , , , , , , ,

Thursday, June 27, 2013

Remap Ctrl key on Lubuntu


LXKeymap > Tools > Show/Hide Profiles > Options > Keyboard Options

These are the two options I like to configure on all my Linux boxes:

  • Caps Lock as Ctrl
  • Key sequence to kill the X server

Click Ok and then Apply.
No need to logout nor anything, changes are immediate.
One thing I've noticed is that the options you select while on LKKeymap, even tho selected, there are no ticks on the boxes, it seems a little awkward, but the thing works.
The other thing is that the setting is not persistent... You'll have to redo this after a logout or reboot.
I'll look up for another option, as having to do this all the time is a PITA.

Labels: , , ,

Wednesday, May 30, 2012

Gnome 3 customizations

Couple of settings to configure the Gnome 3 DE to my likings:

gsettings set org.gnome.desktop.background show-desktop-icons true

Enables the use of the Desktop as, well... Just that, as a Desktop.


gsettings set org.gnome.desktop.interface gtk-key-theme "Emacs"

Of course, this one sets the system wide keyboard combos to Emacs like ones, the way the whole Universe should be... My key bindings or the Highway!


Labels: , , , , , ,

Sunday, February 13, 2011

Make Gedit more like Emacs

As an Emacs user, I find ultra annoying that, even if I have setup my GTK apps to use Emacs key bindings gedit refuses to do so on some of those.

So Googled a bit, and found a nice little plugin for Gedit that allows you to customize all the keyboard shortcuts that as they appear on the menu.
To install EditShortcuts on Lucid Lynx, besides having to manually create the directory "plugins" on "~/.gnome2/gedit/" I had to also enable the plugin like:

Edit > Preferences > Plugins

After that it did showed up under the Tools menu entry.

I have been able to get rid of most of the really annoying ones, like: Ctrl+N & Ctrl+H and now they do obey their Emacs instructions, I'm still looking for the one that will allow me to get rid of the dread Gedit action that happens when you use Ctrl+K (incidentally I love that one for Emacs, kill till the end of the line)

On Os X (meaning on the Gedit equivalent of sorts, TextEdit) things are pretty more simple, because the modifier (or operation) key is the Apple (command) one, leaving you free to use the Emacs keybinds without fucking up things like Copy & Paste, etc.

Why not simply use Emacs and be done with? I do, but wanted to test the GTK one on this box, but there is a bug that crashes the GTK version no matter what if you run Gnome Global Menu, so there is only emacs-nox, or actually emacs -nw for launching the GTK version on a Terminal.

EditShortcuts
Gedit Keyboard Shortcuts


Labels: , , , , , ,

Saturday, June 26, 2010

Jawa Saturday

It is cold (for local standards), rainy (for local standards) and humid (for any standard), in other words, it is beautiful here in Bs. As.
So, without anything else to do, got me a Green 753+, a really left over form work (who the hell might want to store this crap for so many years????)
Disassembly it in a jiffy, the HDD is a really small 2 GB, the RAM is inexistent; but the keyboard seems nice, quite sturdy, and has the US layout, definitively a keeper.

Labels: , ,

Tuesday, May 04, 2010

Lucid Lynx: after install tidbits (I)

- Get the cursors the way I want them:
cd /usr/share/icons/DMZ-White/cursors/
sudo cp xterm xterm.ORIG
sudo cp arrow xterm
cd /usr/share/icons/DMZ-Black/cursors/
sudo cp xterm xterm.ORIG
sudo cp arrow xterm


- Turn off services:
Bluetooth
Print Queue Applet


- Keyboard customization:
Ctrl key position
Make CapsLock an additional Ctrl

Alt/Win key behavior
Meta is mapped to Win keys

Key sequence to kill the X server
Control + Alt + Backspace


- Reduce fonts size:
Every single font one size down from the defaults, except the Window title font, which get 2 stops down the road and on top of that, it gets to be a regular font, NO bold.


- gconf settings:
/usr/bin/gconftool-2 --set /desktop/gnome/interface/buttons_have_icons --type bool true
/usr/bin/gconftool-2 --set /desktop/gnome/interface/menus_have_icons --type bool true
/usr/bin/gconftool-2 --set /desktop/gnome/interface/toolbar_icons_size small-toolbar --type string
/usr/bin/gconftool-2 --set /desktop/gnome/interface/gtk_key_theme Emacs --type string
sudo -u gdm gconftool-2 --set --type boolean /apps/gdm/simple-greeter/disable_user_list true
sudo -u gdm gconftool-2 --set /desktop/gnome/sound/event_sounds --type bool false


- Package installation:
sudo aptitude install openvpn gip emacs23-nox
sudo aptitude install pidgin wmctl openssh-server
sudo aptitude install unrar rar

Thru Ubuntu Software Center:

- Wine Microsoft Windows Compatibility Layer (dummy package) (see here)
- Remove Games


- Package removal:
sudo aptitude remove empathy


- Firefox addons:

Tiny Menu
https://addons.mozilla.org/en-US/firefox/addon/1455

Flash Block
https://addons.mozilla.org/en-US/firefox/addon/433

AdBlock
https://addons.mozilla.org/en-US/firefox/addon/1865

- Gnome Global Menu:
sudo add-apt-repository ppa:globalmenu-team
sudo aptitude update
sudo aptitude install gnome-globalmenu

Logout from your Gnome session, log back in; add Global Menu to the Main Panel.
Logout once again, and then back in, due to this bug

Labels: , , , , , , ,

Saturday, July 04, 2009

Keyboard shortcuts


A couple of keyboard shortcuts I have been using on Os X for a while now.

They actually don't do instead of doing, or, better, they replace the default key binding that I find stupid for the given programs.

On the case of Mail.app, I have disabled 'Command + q', I can't recall how many times I have typed that instead of 'Command + w' while perusing an email...

For iTunes, I simply hate typing 'Command + g' instead of the mopst useful keyboard shortucut on Os X: 'Command + H', and thus getting the Artwork Column displayed.

Labels: , , ,

Sunday, June 07, 2009

Put the Windows key to work

A little something I have being using for a while.
I like to use Windows key on my keyboard (since its there... It better be useful anyway :) )
So, on Gnome/ Ubuntu, to be able to actually use the Windows key as a combinator with another one to do something, that is, to transform it onto a keyboard shortcut, you have to take an extra step, to modify its default behavior.

All of this, you know, so that pressing the freaking Windows key + another key allows you to do something.

So, goto:

System > Preferences > Keyboard

Select the "Layouts" tab, and then click on the "Layout Options", and then open the menu called "Alt/Win key behavior" and check the option 'Hyper is mapped to Win-keys'.

You are done, now goto the plain vanilla:

System > Preferences > Keyboard Shortcuts

And setup the keyboard that you want using the freaking Windows key.

Labels: , , , ,

Sunday, October 12, 2008

Cleaning the Apple Pro Keyboard


It is a dirty & messy job, but someone has to step up and do it.
This couldn't wait any long, the keyboard was getting, I shouldn't say smelly, but near.

Besides, I effing love this keyboard, period, the best one I had so far, the clickyness of it is amazing, perhaps, maybe perhaps, when I get my hands on my Happy Hacking that will change, but for now, this one is the king.

The amount of gunk I pulled out from beneath the keys is amazing and disgusting at the same time.

Labels: , , ,

Monday, September 29, 2008

Disable CAPS LOCK on Gnome

Actually, on what ever you might be running X Window on.
I hate the CAPS LOCK key, a lot.

What I did was adding this:

## -----------------------------------------------

## Disable CAPS LOCK
/usr/bin/xmodmap -e "remove lock = Caps_Lock"

## -----------------------------------------------

to the file '/etc/X11/xinit/xinitrc', before this line:

# invoke global X session script
. /etc/X11/Xsession



Couple of links I found regarding this:

Disable and Enable Caps Lock in Ubuntu
Disable capslock ?
How to remap the Caps Lock key as another Control key

Labels: , , ,