با i3wm دوست باشیم ...

حدود یک ماهی هست که دارم از i3twm استفاده میکنم. بهترین مزیتی که i3 نسبت به میزکارهایی مثل گنوم و کی دی ای و ...  داره اینکه که استفاده از موشی را به حداقل می‌رسونه و تمرکز کاربر را متوجه صفحه کلید می‌کنه. خوشبختانه بعد از انتشار اسکرین‌شات از i3 داخل گروه تلگرامی آرچ لینوکس بعضی از دوستان درخواست کردن تا پیکره‌بندی‌های استفاده شده در اسکرین‌شات را به اشتراک بگذارم. خوب منم دست بکار شدم و یه مطلب راجع بهش نوشتم.

در ابتدا i3gaps را نصب می‌کنیم.

 yaourt -S i3-gaps

بعد از نصب i3-gaps سیستم را مجددا راه‌اندازی کنید و از قسمت display manager  نشست i3 را انتخاب کنید تا توزیع شما با i3 بالا بیاید. حالا i3 از شما جهت انتخاب کلید Mod سوال میکنه شما پاسخ مثبت به اون بدید تا کلید window به عنوان کلید Mod انتخاب بشه و همچنین فایل پیکره بندی i3 ساخته بشه.

الان زمان نصب بسته‌های مورد نیاز است.

sakura
rofi
i3blocks
feh
volumeicon
setxkbmap
conky
compton
nm-applet
clipit
kbdd
xfce4-power-manager
gnome-screenshot
amixer
vifm
lxappearance
udiskie

فونت‌های زیر را بر روی سیستم خود نصب کنید.

strasua

ttf-font-awesome

فونت دوم را می‌توانید با دستور زیر نصب نمایید.

yaourt -S ttf-font-awesome

در مرحله بعد نیاز به یک کاغذ دیواری مناسب داریم که می‌تونید از اینجا دانلودش کنید. من کاغذ دیواری را در دایرکتوری Downloads کپی کردم.

حالا زمان پیکره‌بندی i3 فرا رسیده فایل config را در آدرس زیر باز کنید.

~/.config/i3/config

پیکره‌بندی زیر را در فایل config بنویسید و فایل را ذخیره نمایید.


##################################################
#############                         #######################
###                i3twm configure                                ####
#############                        #########################################################################
############ i3gaps ###############################
for_window [class="^.*"] border pixel 1
 
gaps inner 10
gaps outer 0
 
smart_gaps on
smart_borders on
 
 
set $mode_gaps Gaps: (o) outer, (i) inner
set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global)
set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global)
bindsym $mod+Shift+g mode "$mode_gaps"
 
mode "$mode_gaps" {
        bindsym o      mode "$mode_gaps_outer"
        bindsym i      mode "$mode_gaps_inner"
        bindsym Return mode "default"
        bindsym Escape mode "default"
}
mode "$mode_gaps_inner" {
        bindsym plus  gaps inner current plus 5
        bindsym minus gaps inner current minus 5
        bindsym 0     gaps inner current set 0
 
        bindsym Shift+plus  gaps inner all plus 5
        bindsym Shift+minus gaps inner all minus 5
        bindsym Shift+0     gaps inner all set 0
 
        bindsym Return mode "default"
        bindsym Escape mode "default"
}
mode "$mode_gaps_outer" {
        bindsym plus  gaps outer current plus 5
        bindsym minus gaps outer current minus 5
        bindsym 0     gaps outer current set 0
 
        bindsym Shift+plus  gaps outer all plus 5
        bindsym Shift+minus gaps outer all minus 5
        bindsym Shift+0     gaps outer all set 0
 
        bindsym Return mode "default"
        bindsym Escape mode "default"
}
########################################
################ Color ###################
# class                 border  backgr. text    indicator child_border
client.focused          #E12525 #EFDA84 #000000 #0792FC   #285577
client.focused_inactive #E12525 #5f676a #ffffff #484e50   #5f676a
client.unfocused        #333333 #222222 #ffffff #292d2e   #222222
client.urgent           #E12525 #900000 #ffffff #900000   #900000
client.placeholder      #E12525 #0c0c0c #ffffff #000000   #0c0c0c
client.background       #ffffff
########################################
set $mod Mod4
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:strasua  9
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+Return exec sakura
# kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
bindsym $mod+d exec rofi -show run -lines 10 -eh 1 -width 600 -padding 8 -opacity 95 -font strasua\ 10
# Switch between windows (with rofi):
bindsym $mod+Tab exec --no-startup-id rofi -show window -case-sensitive -bg 'white' -bc '#569BE4' -bw 2 -fg 'black' -hlbg '#569BE4' -hlfg 'white' -font strasua\ 10 -opacity 90 -eh 1.5 -lines 10 -columns 1 -width 40 -location 0 -padding 5 #-auto-select    
# change focus
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+semicolon focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+semicolon move right
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+h split h
# split in vertical orientation
bindsym $mod+v split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# customize workspace name
set $WS1 1 : 
set $WS2 2 : 
set $WS3 3 : 
set $WS4 4 : 
set $WS5 5 : 
set $WS6 6 : 
set $WS7 7 : 
set $WS8 8 : 
set $WS9 9 : 
set $WS0 10 : 
# switch to workspace
bindsym $mod+1 workspace $WS1
bindsym $mod+2 workspace $WS2
bindsym $mod+3 workspace $WS3
bindsym $mod+4 workspace $WS4
bindsym $mod+5 workspace $WS5
bindsym $mod+6 workspace $WS6
bindsym $mod+7 workspace $WS7
bindsym $mod+8 workspace $WS8
bindsym $mod+9 workspace $WS9
bindsym $mod+0 workspace $WS0
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $WS1
bindsym $mod+Shift+2 move container to workspace $WS2
bindsym $mod+Shift+3 move container to workspace $WS3
bindsym $mod+Shift+4 move container to workspace $WS4
bindsym $mod+Shift+5 move container to workspace $WS5
bindsym $mod+Shift+6 move container to workspace $WS6
bindsym $mod+Shift+7 move container to workspace $WS7
bindsym $mod+Shift+8 move container to workspace $WS8
bindsym $mod+Shift+9 move container to workspace $WS9
bindsym $mod+Shift+0 move container to workspace $WS0
# reload the configuration file
bindsym $mod+Shift+c reload
################ Restart i3 #####################
bindsym $mod+Shift+r restart
#################################################
################ Resize Window ##################
mode "resize" {
        # These bindings trigger as soon as you enter the resize mode
        # Pressing left will shrink the window’s width.
        # Pressing right will grow the window’s width.
        # Pressing up will shrink the window’s height.
        # Pressing down will grow the window’s height.
        bindsym j resize shrink width 10 px or 10 ppt
        bindsym k resize grow height 10 px or 10 ppt
        bindsym l resize shrink height 10 px or 10 ppt
        bindsym semicolon resize grow width 10 px or 10 ppt
        # same bindings, but for the arrow keys
        bindsym Left resize shrink width 10 px or 10 ppt
        bindsym Down resize grow height 10 px or 10 ppt
        bindsym Up resize shrink height 10 px or 10 ppt
       bindsym Right resize grow width 10 px or 10 ppt
        # back to normal: Enter or Escape
        bindsym Return mode "default"
        bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
#################################################
################ i3Bar Configure #####################
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
        status_command i3blocks -c ~/.i3blocks.conf
#    position top
    colors {
#               background #2f343f
        background #1d1f23
               }
}
###########################################
################ Startup #####################
exec --no-startup-id udiskie -a -t -F &
exec --no-startup-id feh --bg-scale ~/Downloads/linux.jpg
exec --no-startup-id volumeicon &
exec --no-startup-id setxkbmap -option grp:switch,grp:alt_shift_toggle us,ir
exec --no-startup-id sleep 2s ; conky -c ~/.conkyrc/conkyrc
exec --no-startup-id compton --config ~/.compton.conf -b
exec --no-startup-id nm-applet &
exec --no-startup-id clipit &
exec --no-startup-id kbdd &
exec --no-startup-id xfce4-power-manager &
##############################################
################ Exit #####################
set $mode_system System (l) lock, (e) logout, (h) hibernate, (r) reboot, (s) shutdown
mode "$mode_system" {
    bindsym l exec --no-startup-id i3exit lock, mode "default"
    bindsym e exec --no-startup-id i3-msg exit, mode "default"
    bindsym h exec --no-startup-id systemctl hibernate, mode "default"
    bindsym r exec --no-startup-id systemctl reboot, mode "default"
    bindsym s exec --no-startup-id systemctl poweroff, mode "default"
    # back to normal: Enter or Escape
    bindsym Return mode "default"
    bindsym Escape mode "default"
}
bindsym $mod+shift+e mode "$mode_system"
##########################################
################ Volume #####################
bindsym XF86AudioRaiseVolume exec amixer sset Master 5%+
bindsym XF86AudioLowerVolume exec amixer sset Master 5%-
bindsym XF86AudioMute exec amixer sset Master toggle && twmnc -t "Volume mute"
#############################################
################ Brightness #################
# Sreen brightness controls
bindsym XF86MonBrightnessUp exec xbacklight -inc 05 && pkill -RTMIN+20 i3blocks
bindsym XF86MonBrightnessDown exec xbacklight -dec 05 && pkill -RTMIN+20 i3blocks
#############################################
################ Screenshot #################
bindsym Print exec "gnome-screenshot"
############################################
################ Output VGA #################
workspace 10 output VGA1
#############################################
################ Touch Pad ##################
exec synclient HorizScrollDelta=-65 VertScrollDelta=-65
# Turn off edge scrolling
exec synclient HorizEdgeScroll=1 VertEdgeScroll=1
# Turn off tap click (single finger, two finger, and 3 finger)
exec synclient TapButton1=1 TapButton2=1 TapButton3=1
#############################################

برای کار کردن بعضی قسمت‌ها در i3blocks باید از یه سری اسکریپت استفاده کنید برای مثلا اسکریپت تنظیم نور . برای این اسکریپت‌ها ابتدا این آرشیو را دانلود و در آدرس زیر کپی کنید.

~/.config/i3

‌در دایرکتوری خانگی خودتون یه فایل به نام .i3blocks.conf بسازید.

vim .i3blocks.conf

و پیکره‌بندی زیر را در آن بنویسید و فایل را ذخیره کنید.

# We use the global settings as a shortcut to define our own separator.
# Based on the default i3blocks config file.
[separator]
[Time]
label= :
command=date '+%H:%M'
color=#FC1919
interval=1
[separator]
label= :
command=jdate +%D
color=#77d596
interval=1
align=center
[separator]
[separator]
full_text=<
align=center
color=#FFFDD0
separator=false
separator_block_width=3
[separator]
[battery]
label= :
color=#ff9900
command=~/.config/i3/script/battery BAT1
interval=1
[separator]
full_text=<
align=center
color=#FFFDD0
separator=false
separator_block_width=3
[separator]
[keyboard]
label= :
command=xkblayout-state print %s
interval=1
color=#BABDF0
[separator]
[backlight]
label= :
command=~/.config/i3/script/brightness.rb intel_backlight
color=#E78797
interval=1
format=json
[separator]
full_text=<
align=center
color=#FFFDD0
separator=false
separator_block_width=3

 حالا نوبت به  پیکره‌بندی کانکی می‌رسه. فایل آرشیو زیر را دانلود کرده و پس از اکسترکت در دایرکتوری خانگی خود  کپی کنید. در ابتدای آموزش  برنامه Compton را نصب کردیم حال نوبت به پیکره‌بندی آن می‌رسد.  در دایرکتوری خانگی خودتون یه فایل متنی به نام compton.conf ایجاد کرده و مقادیر زیر را در آن بنویسید.

# Thank you code_nomad: http://9m.no/ꪯ鵞#################################
#
# Backend
#
################################## Backend to use: "xrender" or "glx".
# GLX backend is typically much faster but depends on a sane driver.
backend = "glx";#################################
#
# GLX backend
#
#################################glx-no-stencil = true;# GLX backend: Copy unmodified regions from front buffer instead of redrawing them all.
# My tests with nvidia-drivers show a 10% decrease in performance when the whole screen is modified,
# but a 20% increase when only 1/4 is.
# My tests on nouveau show terrible slowdown.
# Useful with --glx-swap-method, as well.
glx-copy-from-front = false;# GLX backend: Use MESA_copy_sub_buffer to do partial screen update.
# My tests on nouveau shows a 200% performance boost when only 1/4 of the screen is updated.
# May break VSync and is not available on some drivers.
# Overrides --glx-copy-from-front.
# glx-use-copysubbuffermesa = true;# GLX backend: Avoid rebinding pixmap on window damage.
# Probably could improve performance on rapid window content changes, but is known to break things on some drivers (LLVMpipe).
# Recommended if it works.
# glx-no-rebind-pixmap = true;
# GLX backend: GLX buffer swap method we assume.
# Could be undefined (0), copy (1), exchange (2), 3-6, or buffer-age (-1).
# undefined is the slowest and the safest, and the default value.
# copy is fastest, but may fail on some drivers,
# 2-6 are gradually slower but safer (6 is still faster than 0).
# Usually, double buffer means 2, triple buffer means 3.
# buffer-age means auto-detect using GLX_EXT_buffer_age, supported by some drivers.
# Useless with --glx-use-copysubbuffermesa.
# Partially breaks --resize-damage.
# Defaults to undefined.
glx-swap-method = "undefined";#################################
#
# Shadows
#
################################## Enabled client-side shadows on windows.
shadow = true;
# Don't draw shadows on DND windows.
no-dnd-shadow = true;
# Avoid drawing shadows on dock/panel windows.
no-dock-shadow = true;
# Zero the part of the shadow's mask behind the window. Fix some weirdness with ARGB windows.
clear-shadow = true;
# The blur radius for shadows. (default 12)
shadow-radius = 5;
# The left offset for shadows. (default -15)
shadow-offset-x = -5;
# The top offset for shadows. (default -15)
shadow-offset-y = -5;
# The translucency for shadows. (default .75)
shadow-opacity = 0.5;# Set if you want different colour shadows
# shadow-red = 0.0;
# shadow-green = 0.0;
# shadow-blue = 0.0;# The shadow exclude options are helpful if you have shadows enabled. Due to the way compton draws its shadows, certain applications will have visual glitches
# (most applications are fine, only apps that do weird things with xshapes or argb are affected).
# This list includes all the affected apps I found in my testing. The "! name~=''" part excludes shadows on any "Unknown" windows, this prevents a visual glitch with the XFWM alt tab switcher.
shadow-exclude = [
    "! name~=''",
    "name = 'Notification'",
    "name = 'Plank'",
    "name = 'Docky'",
    "name = 'Kupfer'",
    "name = 'xfce4-notifyd'",
    "name *= 'VLC'",
    "name *= 'compton'",
    "name *= 'Chromium'",
    "name *= 'Chrome'",
    "class_g = 'Conky'",
    "class_g = 'Kupfer'",
    "class_g = 'Synapse'",
    "class_g ?= 'Notify-osd'",
    "class_g ?= 'Cairo-dock'",
    "class_g ?= 'Xfce4-notifyd'",
    "class_g ?= 'Xfce4-power-manager'",
    "_GTK_FRAME_EXTENTS@:c"
    ];
# Avoid drawing shadow on all shaped windows (see also: --detect-rounded-corners)
shadow-ignore-shaped = false;#################################
#
# Opacity
#
#################################menu-opacity = 1;
inactive-opacity = 1;
active-opacity = 1;
frame-opacity = 1;
inactive-opacity-override = false;
alpha-step = 0.06;# Dim inactive windows. (0.0 - 1.0)
# inactive-dim = 0.2;
# Do not let dimness adjust based on window opacity.
# inactive-dim-fixed = true;
# Blur background of transparent windows. Bad performance with X Render backend. GLX backend is preferred.
# blur-background = true;
# Blur background of opaque windows with transparent frames as well.
# blur-background-frame = true;
# Do not let blur radius adjust based on window opacity.
blur-background-fixed = false;
blur-background-exclude = [
    "window_type = 'dock'",
        "window_type = 'desktop'"
        ];#################################
#
# Fading
#
################################## Fade windows during opacity changes.
fading = true;
# The time between steps in a fade in milliseconds. (default 10).
fade-delta = 4;
# Opacity change between steps while fading in. (default 0.028).
fade-in-step = 0.03;
# Opacity change between steps while fading out. (default 0.03).
fade-out-step = 0.03;
# Fade windows in/out when opening/closing
# no-fading-openclose = true;# Specify a list of conditions of windows that should not be faded.
fade-exclude = [ ];#################################
#
# Other
#
################################## Try to detect WM windows and mark them as active.
mark-wmwin-focused = true;
# Mark all non-WM but override-redirect windows active (e.g. menus).
mark-ovredir-focused = true;
# Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused instead of using FocusIn/Out events.
# Usually more reliable but depends on a EWMH-compliant WM.
use-ewmh-active-win = true;
# Detect rounded corners and treat them as rectangular when --shadow-ignore-shaped is on.
detect-rounded-corners = true;# Detect _NET_WM_OPACITY on client windows, useful for window managers not passing _NET_WM_OPACITY of client windows to frame windows.
# This prevents opacity being ignored for some apps.
# For example without this enabled my xfce4-notifyd is 100% opacity no matter what.
detect-client-opacity = true;# Specify refresh rate of the screen.
# If not specified or 0, compton will try detecting this with X RandR extension.
refresh-rate = 0;# Set VSync method. VSync methods currently available:
# none: No VSync
# drm: VSync with DRM_IOCTL_WAIT_VBLANK. May only work on some drivers.
# opengl: Try to VSync with SGI_video_sync OpenGL extension. Only work on some drivers.
# opengl-oml: Try to VSync with OML_sync_control OpenGL extension. Only work on some drivers.
# opengl-swc: Try to VSync with SGI_swap_control OpenGL extension. Only work on some drivers. Works only with GLX backend. Known to be most effective on many drivers. Does not actually control paint timing, only buffer swap is affected, so it doesn’t have the effect of --sw-opti unlike other methods. Experimental.
# opengl-mswc: Try to VSync with MESA_swap_control OpenGL extension. Basically the same as opengl-swc above, except the extension we use.
# (Note some VSync methods may not be enabled at compile time.)
vsync = "opengl-swc";# Enable DBE painting mode, intended to use with VSync to (hopefully) eliminate tearing.
# Reported to have no effect, though.
dbe = false;
# Painting on X Composite overlay window. Recommended.
paint-on-overlay = true;# Limit compton to repaint at most once every 1 / refresh_rate second to boost performance.
# This should not be used with --vsync drm/opengl/opengl-oml as they essentially does --sw-opti's job already,
# unless you wish to specify a lower refresh rate than the actual value.
sw-opti = true;# Unredirect all windows if a full-screen opaque window is detected, to maximize performance for full-screen windows, like games.
# Known to cause flickering when redirecting/unredirecting windows.
# paint-on-overlay may make the flickering less obvious.
unredir-if-possible = true;# Specify a list of conditions of windows that should always be considered focused.
focus-exclude = [ ];# Use WM_TRANSIENT_FOR to group windows, and consider windows in the same group focused at the same time.
detect-transient = true;
# Use WM_CLIENT_LEADER to group windows, and consider windows in the same group focused at the same time.
# WM_TRANSIENT_FOR has higher priority if --detect-transient is enabled, too.
detect-client-leader = true;#################################
#
# Window type settings
#
#################################wintypes:
{
   tooltip =
      {
        # fade: Fade the particular type of windows.
          fade = true;
        # shadow: Give those windows shadow
          shadow = false;
        # opacity: Default opacity for the type of windows.
          opacity = 0.85;
        # focus: Whether to always consider windows of this type focused.
          focus = true;
                       };
};

یک بار سیستم خود را restart کنید تا نتیجه نهایی را مشاهده کنید.

 

 

سورنا
0
سورنا
سلام واقعا دستتون درد نکنه
من تو سایت های خارجی هم گشتم اما چیزای زیادی پیدا نکردم. لطفا پیکره بندی های بیشتری بزارید
پنج شنبه خرداد 1396 پاسخ دادن | پاسخ به نقل قول | نقل قول کردن

فرم نظر دهی


تصویر امنیتی جدید تصویر امنیتی
111108
TodayToday281
YesterdayYesterday245
This_WeekThis_Week1351
This_MonthThis_Month4399
All_DaysAll_Days111108