Showing posts with label i3. Show all posts
Showing posts with label i3. Show all posts

Sunday, February 5, 2017

Arch linux හා i3 window manager : වැදගත් configurations කීපයක්


i3 එකේ ඔක්කොම වැඩ වෙන්නේ i3 config file එකෙන්. අපි i3 අපිට ඕනි විදියට හදාගන්න නම් config file එක edit කරන්න ඕනි.
config file එක arch linux වල
~/.config/i3
කියන directory එකේ තියෙනවා.
සැ.යු. යට තියෙන commands config එකට දැම්මට පස්සේ එක වැඩ කරන්න නම් i3 reload කරන්න.
(reload කරන හැටි අන්තිමට තියෙනවා)   


1. wallpaper එකක් set කර ගන්න 
පහත line එක config file එකට add කරන්න.
exec --no-startup-id feh --bg-fill ~/Pictures/pic.png 
 ~/Pictures/pic.png කියන්නේ පින්තුරේ තියෙන තැන.

2. screen එක lock කරන්න   
පහත line එක config file එකට add කරන්න.
bindsym $mod+l exec i3lock
 දැන් අපිට් පුළුවන් $mod key එක එකක් L key එක ඔබලා screen එක lock කරන්න.
(හදිස්සියෙවත් ඕක වැඩ නෑ කියන්නේ i3lock එක install කරලා නෑ වගේ සීන් එකක්. පොඩ්ඩක් බලන්න i3lock install කරලා ද කියලා)

3. screen print කරන්න  
මම use කරන්නේ scrot කියන tool එක screen ප්‍රින්ට් කරන්න. කැමති ටූල් එකක් තෝරාගෙන keys bind කරගන්න පුලුවන් අවුලක් නෑ.

scrot install කරන්න terminal එකේ මේ command එක ගහන්න.
pacman -S scrot
අපි image editor එකකුත් ඒ එක්කම install කරගමු ගහන screenshot එක open කරගන්න.
gimp image editor එක දාගන්න
pacman -S gimp
කියල ටෙර්මිනල් එකේ ගහන්න

හරි දැන් print key එක scrot printscreen එකට bind කරන්න පහත lines config file එකට add කරන්න.
# print screen - whole screen 
bindsym Print exec scrot -e 'mv $f /tmp/ && gimp /tmp/$f' 
# print screen - select window or rectangle 
bindsym $mod+Print exec scrot -s -e 'mv $f /tmp/ && gimp /tmp/$f'
දැන් හරි.


තව මොනවද කරන්නේ? 

ඔය මං කිව්වේ වැදගත් වෙන configurations ටිකක් විතරයි i3 පටන් ගන්න කෙනෙකුට.
ඔය කට්ටියට දැන් ඔය configuration commands බැලුවොත් මේ වගේ දේවල් ටිකක් නිරීක්ෂණය කරන්න පුළුවන්.

  • #            - comment   
  • bindsym - key combination එකක් linux command එකකට bind කරගන්න පුළුවන්.
                        මේ වගේ syntax එකක් තම එකට තියෙන්නේ.
                     bindsym key_combination linux_command
  • නිකන්ම් configuration file එකේ linux command එකක් දැම්මොත් එක i3 start වෙද්දීම run වෙනවා.
    (wallpaper එකක් set කර ගන්න උදාහරනේ වගේ)






i3 reload කරන්න පුළුවන් යට තියෙන විදි දෙකෙන්ම
key combination 
$mod + shift + r 
terminal එකේ 
i3-msg restart


Arch linux හා i3 window manager : audio functions configure කිරීම්



Arch linux හා i3 window manager වල audio keys වලින් වැඩ කරන්න නම් අපි ඒ keys අදාල functionalities වලට assign කරන්න ඕනි. අපි බලමු කොහොමද එක කරන්නේ කියලා.

STEP 01 - installing audio functions package

මුලින්ම linux වලට audio functionalities පහසුවෙන් කරගන්න alsa-utils package එක දාගෙන ඉන්න ඕනි.
pacman -S alsa-utils
STEP 02 - assigning keys

හරි, දැන් අපි volume keys වලට sound අඩු වැඩි කරන සහ mute කරන commands අදාල keys වලට bind කරගන්න ඕනි. එකට i3 config file එක open කරගන්න.
(config file එක ~/.config/i3 directory එකේ තියෙන්නේ )
ඒ file එකට පහත lines ටික එකතු කරගන්න.

i3 config file
#volume control
bindsym XF86AudioRaiseVolume exec amixer -q set Master 1%+ unmute
bindsym XF86AudioLowerVolume exec amixer -q set Master 1%- unmute
bindsym XF86AudioMute exec amixer -q set Master toggle

දැන් අපි i3 reload කරලා බැලුවොත් volume down, volume up සහ mute keys වලින් අදාල functions කරගන්න පුළුවන් කියල බලාගන්න පුළුවන්.
හැබැයි graphically කොහෙවත් එක අපිට පෙන්නන්නේ නෑ. එක නිසා අපි දැන් volume එක status bar එකේ පෙන්නන්න හදාගමු.

STEP 03 - show volume graphically

status bar එකේ volume එක පෙන්නන්න හදාගන්න නම් i3status.conf file එක edit කරන්න ඕනි. එකට යට තියෙන code එක අන්තිමට එකතු කරන්න විතරයි තියෙන්නේ.
i3status.conf file 
#volume show
volume master {
format = "♪ %volume"
device = "default"
mixer = "Master"
mixer_idx = 0
}
order += "volume master"

දැන් i3 reload කරන්න.



i3 reload කරන්න පුළුවන් යට තියෙන විදි දෙකෙන්ම
key combination 
$mod + shift + r 
terminal එකේ 
i3-msg restart

Saturday, February 4, 2017

Arch linux හා i3 window manager : Install කිරීම


i3 කියන්නේ window manager එකක්. Linux වල desktop environment එකක් නැතිව අපිට window manager එකක් පාවිච්චි කරන්න පුළුවන්. ඔය උඩ තියෙන්න i3 වල screenshot එකක්. මේක use කරන එක ගොඩක් developersලට පහසුයි වගේම ඉකමනින් වැඩක් කර ගන්න පුළුවන්. මොකද keys එකතු කරලා (key bindings) අපිට ඕනි විදියට application open/close වෙන එව්වා වගේම terminal commands run කරවන්න පුළුවන්.
අනික් එක තමා window tiling.

i3 වල feature (resource : https://i3wm.org)

දැන් බලමු කොහොමද i3 arch linux වලට දාගන්නේ කියලා.

මුලින්ම terminal එක open කරලා,
pacman -S i3 
ඊට පස්සේ all දීල components 3ම install කරගන්න.

ටෙර්මිනල් එකේ 
startx 
කියල type කරන්න. එතකොට i3 window manager එකට යනවා.

මුල්ම සැරේට යද්දී අහනවා arch configure කරන්න. ඒ configure screen එකේ $mod යතුර තෝරන්න ඕනි.
ගොඩක් කට්ටිය එක window key එක තමා $mod එකට දාන්නේ.
  • terminal එක open කරන්න නම්
    $mod + enter
    key combination එක පාවිච්චි කරන්න පුළුවන්.

  • i3 manager එකෙන් exit වෙන්න නම්
    $mod + shift  + E
    key combination එක පාවිච්චි කරන්න පුළුවන්.

(configure screen එක අවේ නැති උනොත්, default $mod key එක තමා alt key එක)

i3 එකේ ඔක්කොම වැඩ වෙන්නේ i3 config file එකෙන්. අපි i3 අපිට ඕනි විදියට හදාගන්න නම් config file එක edit කරන්න ඕනි.
config file එක arch linux වල
$HOME/.config/i3
කියන directory එකේ තියෙනවා ($HOME කියන්නේ userගේ home directory එක)









i3 එකේ status bar එක වෙනස් කරන්න නම්

/etc/i3status.conf 

කියන file එක edit කරන්න ඕනි


පස්සේ පොස්ට් එකකින් බලමු කොහොමද i3 අපිට ඕනි විදියට configure කරන්නේ කියලා!