Tagged: Linux

Building My Work Environment (Part 6)

Part 6 - Let's type in Japanese

Now, we can view Japanese in terminal, let's try installing some input method framework. The CHANGES_AND_HINTS.TXT for Slackware64 14.2 suggests to use SCIM, but according to Arch wiki, SCIM is a dead project now. So, we'll try installing IBus.

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

Installation:

Installation of ibus as well as its dependencies and Japanese engine, ibus-anthy, is no difficult tasks. If you are planning to input Japanese characters, you might consider installing ibus-qt as well. They are available from Slackbuilds.org as usual.

Configurations:

Once the installation is done, start the setup program to do some configurations.$ ibus-setup

All I changed was the keyboard shortcuts and input methods. For keyboard shortcuts, I was hoping Alt+Shift would just work but it didn't, so I changed it to Alt+Shift+space.

For input methods, I added Japanese - Anthy to enable Japanese input. You might have noticed that its icon is different from the default one. This is because I replaced its default icon with my own.

The configuration of ibus should be done now. You'll see a small EN icon in its systray. That confirms ibus is running now. Left click on the icon will show you the list available input methods, in this case, English and Japanese - Anthy.

.bashrc:

We need to tell the system that we are using ibus for alternate language inputs after logging out or shutdown. To do this, we update .bashrc and add some environment variables.$ nvim ~/.bashrc ----------------------------------------- ... export GTK_IM_MODULE=ibus export XMODIFIERS=@im=ibus export QT_IM_MODULE=ibus ...

i3/config:

Now, we need to start ibus each time we log into i3 window manager. To do this, we add ibus-autostart to at the end of i3's config file.$ nvim ~/.config/i3/config ----------------------------------------- ... exec --no-startup-id ibus-autostart

Japanese input is enabled and available for terminal as well.

Changing Default Anthy Icon:

I thought the default Anthy icon was not pretty and didn't like it. So, I decided to change it to my own. After searching for the icon in the system, I found it in /usr/share/ibus-anthy/icons/. It's called ibus-anthy.png. I used GIMP to create another icon and replaced it.

That's all!
-gibb

Building My Work Environment (Part 5)

Part 5 - Show Me Japanese in my Terminal

At this moment, any Japanese characters will show up as little rectangle shapes or some gibberish characters. This is, by default, because Slackware uses en_US as its locale. Locale is set using an environment variable, $LANG, and it is set in /etc/profile.d/lang.sh for system wide configuration.

I'd like to be able to read Japanese in terminals for myself, and don't need to apply this for the whole system. All I need to do is to export $LANG in .bashrc.

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

The locale for Japanese can be found by running the following command:$ locale -a | grep -i jp ja_JP.eucjp ja_JP.utf8

The Japanese locale for my system is jp_JP.utf8 (or jp_JP.UTF-8). To apply this in my environment, update .bashrc:$ nvim ~/.bashrc ----------------------------------------- export LANG=ja_JP.UTF-8

After this, either logout and back-in or source .bashrc will display Japanese characters properly in terminal.

However, this brings a bit of problem in my status bar. Time/date is displaying in Japanese as well. This is not what I wanted.

To fix this, I forced i3pystatus to use the en_US locale in its configuration file.$ nvim ~/.config/i3/i3pystatusconfig.py ----------------------------------------- from i3pystatus import Status import os # Setting LANG to en_US to avoid # showing dates in Japanese os.environ['LANG'] = 'en_US' ...

After saving the file, $Mod+Shift+r will change date/time in English.

In next article, let's talk about enabling Japanese input.

That's all!
-gibb

Building My Work Environment (Part 4)

Part 4 - De-Uglifying i3

There are many sites offer themes/themers for i3, like unix121's themer. But I like clean and simple, so I changed just a handful of components.

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

gtk2 Theme

I imported my old gtk2 theme, Morning Glory from Openbox days. This theme can be applied using lxappearance.$ tar -xzvf MorningGlory.tar.gz -C ~/.themes/ ... $ lxappearance

Icons

I still use Faenza icon set. I recently found out that this icon set can be downloaded and installed from slackbuilds.org


Font Awesome Fonts/Icons

i3pystatus I installed in the Part 3 uses icons to display each component, like CPU and memory. For that, font awesome needs to be installed. The latest version at the time of this writing is 5.0.10. Download a zip file, unzip it, and copy otf files from the use-on-desktop folder to system appropriate directory.$ unzip fontawesome-free-5.0.10.zip ... $ cd fontawesome-free-5.0.10/use-on-desktop/ # cp *.otf /usr/share/fonts/OTF # mkfontdir /usr/share/fonts/{TTF,OTF} # mkfontscale /usr/share/fonts/{TTF,OTF} # fc-cache -fv Restart X

To check if the fonts were properly installed, run fc-list:$ fc-list | grep -i awesome ...

Ricty Font

Ricty is Japanese True Type font based on Inconsolata and Circle M+ 1m, optimized for the programming usage. Here is some benefits of using the font:

  • Use Inconsolata for the Latin character glyphs and "Circle M+ 1m" font for other glyphs.
  • Adjust the width of full-width and normal-width character glyphs to 2:1 ratio exactly full and half.
  • Design the comma, period, colon, semicolon and bracket character glyphs to differentiate each other clearly to prevent confusions.
  • Design the high visibility p-sound sign attached Kana character glyphs.
  • Design the En-dash and Em-dash glyphs show them as the broken line to prevent input failures for LaTeX.
  • It shows Em-size space as "box" character because Em-size space often prevents debugging since users usually miss it. With Ricty Diminished font, users can find and fix it easily.

The instruction on how to build Ricty is from this site.

Bash Environment

I changed the style and color of PS1 in .bashrc. PS1='\[\e[38;5;106m\]\A \[\e[38;5;210m\]\u\[\e[38;5;229m\]@\[\e[38;5;220m\]\h\[\e[38;5;252m\][\[\e[38;5;69m\]\w\[\e[38;5;252m\]]\n\[\e[47m\]\[\e[38;5;232m\]$\[\e[00m\] '


=====
~/.bashrc
=====

Color Scheme for ranger

ranger is a text-based file manager with vi/vim key-bindings. Since it's key stroke based, it's perfect for i3. I like my default color scheme. But you can change the color scheme by ~/.config/ranger/colorschemes/.
For syntax highlighting in ranger, I use highlight.


=====
~/.config/ranger/*
=====

Color Scheme for urxvt

The color scheme for urxvt is controlled from .Xresources. I'm currently using gruvbox.

=====
~/.Xresources
=====

rofi

rofi is a window switcher, application launcher, and dmenu replacement, currently maintained by Dave Davenport. It's lightweight and highly customized. My rasi theme file, dark_elements.rasi, and rofi config file are availble.


=====
~/.config/rofi/*
=====

i3lock

I created a bash file to take a screenshot, blur that image, insert a lock icon, and apply it to i3lock.


=====
~/Scripts/i3lock/lock_blur_i3.sh
~/Scripts/i3lock/lock_red.png
=====

In next article, let's talk about displaying Japanese characters in terminal.

That's all!
-gibb

Building My Work Environment (Part 2)

Part 2 - Getting Some Utilities Installed

Now, we've got a base system configured and ready to go. It's time to install some useful utilities.

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

Here is the list of items to be instaled.

File Manager:
  • pcmanfm
  • ranger
  • highlight (for ranger)
  • My customized ranger/rc.conf (~/.config/ranger/)

Music:
  • cmus

Terminal:
Text Editor:
  • nvim
  • My customized nvim/init.vim (~/.config/nvim/)

Virtualization:
  • virtualbox-kernel
  • virtualbox

Web Browser:
  • chromium

Others:
  • python3
  • scrot - Command line screen capture

The above list may grow in the future but these are the absolute minimum software that I need to do my daily tasks.

All of these can be downloaded from Slackbuilds.org, and follow the usual procedure to get them installed.

Now move onto the next step to install/configure my favorite window manager.

In next article, let's talk about my favorite window manager, i3.

That's all!
-gibb

Building My Work Environment (Part 1)

Part 1 - Base System

I have been a long time Slackware Linux user, probably since Slackware 9 or so. Because of its UNIX-like architecture and stability, Slackware has always been the main OS for my workstation (although I do distro hoppings on my laptop among Debian, FreeBSD, and Arch Linux).

This is just my notes for a list of steps/software I need to install to create my work environment from fresh install of Slackware.

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

Partition Scheme:

On my current system, I have 16GB of RAM. So, theoretically, I don't think I need a swap partition; however, just in case my system goes haywire, I reserve 1GB of swap partition.

/dev/sda1 - swap (1GB)
/dev/sda2 - / (around 80GB)
/dev/sda3 - /backup (Rest of space)

Installation of Slackware:

Nothing needs to be noted. Follow its instruction.

Post Installation:

After rebooting the system, there are some tasks need to be done.

Create a user
A regulsr user to do daily tasks. # adduser ... follow the instructions ...

Switch to a generic kernel
Run the following script to output the mkinitrd command with customized options. In my case it was below: # /usr/share/mkinitrd/mkinitrd_command_generator.sh # # mkinitrd_command_generator.sh revision 1.45 # # This script will now make a recommendation about the command to use # in case you require an initrd image to boot a kernel that does not # have support for your storage or root filesystem built in # (such as the Slackware 'generic' kernels'). # A suitable 'mkinitrd' command will be: mkinitrd -c -k 4.4.14 -f ext4 -r /dev/sda2 -m usb-storage:ehci-hcd:ehci-pci:xhci-pci:ohci-pci:xhci-hcd:uhci-hcd:hid:usbhid:i3c-hid:hid_generic:hid-cherry:hid-logitech:hid-logitech-dj:hid-logitech-hidpp:hid-lenovo:hid-microsoft:hid_multitouch:jdb2mbcache:ext4 -u -o /boot/initrd.gz

Update lilo.conf
Since I have LILO installed (the default bootloader of Slackware), its configuration file needs to be updated to boot into the generic kernel. But first run below command to output example sections that need to be updated: # /usr/share/mkinitrd/mkinitrd_command_generator.sh -l /boot/vmlinuz-generic-4.4.14 ... image = /boot/vmlinuz-generic-4.4.14 initrd = /boot/initrd.gz root = /dev/sda2 label = 4.4.14 read-only ...

While editing /etc/lilo.conf, insert lba32, uncomment compact options, and change the timeout value to 0 (zero):# vim /etc/lilo.conf ... lba32 compact ... timeout = 0 ...

Then, run below command to update LILO:# lilo -v

Black listing nouveau video driver
I have rather old video card from NVIDIA which complains about nouveau video driver during its installation. So, the nouveau driver needs to be black listed before installing the video driver from NVIDIA.

To view the name of video driver:# lspci | grep -i vga 01:00.0 VGA compatible controller: NVIDIA Corporation GF106 [GeForce GTS 450] (rev a1)

Then, download xf86-video-nouveau-blacklist-noarch-1.txz from the extra directory in the source tree:# installpkg xf86-video-nouveau-blacklist-noarch-1.txz ... Package xf86-video-nouveau-blacklist-noarch-1.txz installed.

Run the NVIDIA video driver script that's downloaded from the NVIDIA site:# ./NVIDIA-Linux-x86_64-390.48.run

Download Security Patches from slackware.com:

No need to explain:# mkdir /tmp/patches # cd /tmp/patches # wget ftp://ftp.slackware.com/pub/slackware/slackware64-14.2/patches/packages/*.txz ... # upgradepkg *.txz

In next article, let's talk about installing other utilities.

Things To Be Installed:

Fonts:
Icons:
  • Faenza (Slackbuilds.org)

File Manager:
  • pcmanfm
  • ranger
  • highlight (for ranger)
  • My customized ranger/rc.conf (~/.config/ranger/)

Music:
  • cmus

Terminal:
Text Editor:
  • nvim
  • My customized nvim/init.vim (~/.config/nvim/)

Themes:
Version Control:
  • git

Virtualization:
  • virtualbox-kernel
  • virtualbox

Web Browser:
  • chromium

Window Manager:
  • i3
  • i3status
  • i3pystatus
  • My customized i3/conf (~/.config/i3/)
  • My customized i3pystatusconf.py (~/.config/i3/)

Others:
  • rofi - Replacement for dmenu
  • scrot - Command line screen capture
  • My customized rofi/config (~/.config/rofi/)

That's all!
-gibb