SUP3R-US3R

Config i3 + i3blocks

Dec 27th, 2016
6,151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 11.98 KB | None | 0 0
  1. $ sudo nano /etc/vconsole.conf
  2.  
  3. KEYMAP="br-abnt2.map.gz"
  4.  
  5. $ setxkbmap -model abnt2
  6. $ sudo nano /etc/X11/xorg.conf.d/00-keyboard.conf
  7.  
  8. Section "InputClass"
  9.     Identifier "evdev keyboard catchall"
  10.     MatchIsKeyboard "on"
  11.     MatchDevicePath "/dev/input/event*"
  12.     Driver "evdev"
  13.     Option "XkbLayout" "br"
  14.     Option "XkbVariant" "abnt2"
  15. EndSection
  16.  
  17. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  18.  
  19. $ sudo pacman -S i3 lm_sensors hddtemp nitrogen scrot mpc bc compton
  20. $ yaourt -S i3blocks ttf-inconsolata ttf-font-awesome ttf-dejavu terminus-font-ttf terminus-font dmenu2
  21.  
  22. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  23.  
  24.  
  25. # This file has been auto-generated by i3-config-wizard(1).
  26. # It will not be overwritten, so edit it as you like.
  27. #
  28. # Should you change your keyboard layout some time, delete
  29. # this file and re-run i3-config-wizard(1).
  30. #
  31.  
  32. # i3 config file (v4)
  33. #
  34. # Please see http://i3wm.org/docs/userguide.html for a complete reference!
  35.  
  36. set $mod Mod4
  37.  
  38. # Font for window titles. Will also be used by the bar unless a different font
  39. # is used in the bar {} block below.
  40. font pango:monospace 8
  41.  
  42. # Configure border style <normal|1pixel|pixel xx|none|pixel>
  43. new_window pixel 5
  44. new_float normal
  45.  
  46. #Esconder bordas na janela unica
  47. hide_edge_borders true
  48.  
  49. # This font is widely installed, provides lots of unicode glyphs, right-to-left
  50. # text rendering and scalability on retina/hidpi displays (thanks to pango).
  51. #font pango:DejaVu Sans Mono 8
  52.  
  53. # Before i3 v4.8, we used to recommend this one as the default:
  54. # font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
  55. # The font above is very space-efficient, that is, it looks good, sharp and
  56. # clear in small sizes. However, its unicode glyph coverage is limited, the old
  57. # X core fonts rendering does not support right-to-left and this being a bitmap
  58. # font, it doesn’t scale on retina/hidpi displays.
  59.  
  60. # Use Mouse+$mod to drag floating windows to their wanted position
  61. floating_modifier $mod
  62.  
  63. ###MEUS ATALHOS###
  64. bindsym $mod+t exec thunar
  65. bindsym $mod+g exec google-chrome-stable
  66. #bindsym $mod+Shift+p exec
  67. #bindsym $mod+Shift+s exec
  68. bindsym --release Print exec --no-startup-id scrot %Y-%m-%d-%T.png -e 'mv $f ~/Imagens/'
  69. bindsym $mod+Control+l exec i3lock
  70. #bindsym $mod+Control+d exec
  71.  
  72. # multimedia keys
  73. bindsym XF86AudioPlay exec "mpc toggle"
  74. bindsym XF86AudioStop exec "mpc stop"
  75. bindsym XF86AudioNext exec "mpc next"
  76. bindsym XF86AudioPrev exec "mpc prev"
  77. bindsym XF86AudioRaiseVolume exec "amixer set Master 5%+"
  78. bindsym XF86AudioLowerVolume exec "amixer set Master 5%-"
  79.  
  80. # start a terminal
  81. #bindsym $mod+Return exec i3-sensible-terminal
  82. bindsym $mod+Return exec xfce4-terminal
  83.  
  84. # kill focused window
  85. bindsym $mod+Shift+q kill
  86.  
  87. # start dmenu (a program launcher)
  88. bindsym $mod+d exec dmenu_run -o 0.75 -x 800  -y 500 -w 400 -l 5 -h 16 -i -q -fn terminus -nb '#CCCCCC' -nf '#000000' -sb '#BF474D' -sf '#FFFFFF' -p '>_'
  89. # There also is the (new) i3-dmenu-desktop which only displays applications
  90. # shipping a .desktop file. It is a wrapper around dmenu, so you need that
  91. # installed.
  92. # bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
  93.  
  94. # change focus
  95. bindsym $mod+j focus left
  96. bindsym $mod+k focus down
  97. bindsym $mod+l focus up
  98. bindsym $mod+ccedilla focus right
  99.  
  100. # alternatively, you can use the cursor keys:
  101. bindsym $mod+Left focus left
  102. bindsym $mod+Down focus down
  103. bindsym $mod+Up focus up
  104. bindsym $mod+Right focus right
  105.  
  106. # move focused window
  107. bindsym $mod+Shift+j move left
  108. bindsym $mod+Shift+k move down
  109. bindsym $mod+Shift+l move up
  110. bindsym $mod+Shift+ccedilla move right
  111.  
  112. # alternatively, you can use the cursor keys:
  113. bindsym $mod+Shift+Left move left
  114. bindsym $mod+Shift+Down move down
  115. bindsym $mod+Shift+Up move up
  116. bindsym $mod+Shift+Right move right
  117.  
  118. # split in horizontal orientation
  119. bindsym $mod+h split h
  120.  
  121. # split in vertical orientation
  122. bindsym $mod+v split v
  123.  
  124. # enter fullscreen mode for the focused container
  125. bindsym $mod+f fullscreen toggle
  126.  
  127. # change container layout (stacked, tabbed, toggle split)
  128. bindsym $mod+s layout stacking
  129. bindsym $mod+w layout tabbed
  130. bindsym $mod+e layout toggle split
  131.  
  132. # toggle tiling / floating
  133. bindsym $mod+Shift+space floating toggle
  134.  
  135. # change focus between tiling / floating windows
  136. bindsym $mod+space focus mode_toggle
  137.  
  138. # focus the parent container
  139. bindsym $mod+a focus parent
  140.  
  141. # focus the child container
  142. #bindsym $mod+d focus child
  143.  
  144. # switch to workspace
  145. bindsym $mod+1 workspace 1
  146. bindsym $mod+2 workspace 2
  147. bindsym $mod+3 workspace 3
  148. bindsym $mod+4 workspace 4
  149. bindsym $mod+5 workspace 5
  150. bindsym $mod+6 workspace 6
  151. bindsym $mod+7 workspace 7
  152. bindsym $mod+8 workspace 8
  153. bindsym $mod+9 workspace 9
  154. bindsym $mod+0 workspace 10
  155.  
  156. #navigate workspaces next / previous
  157. bindsym $mod+Ctrl+Right workspace next
  158. bindsym $mod+Ctrl+Left workspace prev
  159.  
  160. bindsym $mod+Ctrl+1 move container to workspace 1
  161. bindsym $mod+Ctrl+2 move container to workspace 2
  162. bindsym $mod+Ctrl+3 move container to workspace 3
  163. bindsym $mod+Ctrl+4 move container to workspace 4
  164. bindsym $mod+Ctrl+5 move container to workspace 5
  165. bindsym $mod+Ctrl+6 move container to workspace 6
  166. bindsym $mod+Ctrl+7 move container to workspace 7
  167. bindsym $mod+Ctrl+8 move container to workspace 8
  168. bindsym $mod+Ctrl+9 move container to workspace 9
  169. bindsym $mod+Ctrl+0 move container to workspace 10
  170.  
  171. # Move to workspace with focused container
  172. bindsym $mod+Shift+1 move container to workspace 1
  173. bindsym $mod+Shift+2 move container to workspace 2
  174. bindsym $mod+Shift+3 move container to workspace 3
  175. bindsym $mod+Shift+4 move container to workspace 4
  176. bindsym $mod+Shift+5 move container to workspace 5
  177. bindsym $mod+Shift+6 move container to workspace 6
  178. bindsym $mod+Shift+7 move container to workspace 7
  179. bindsym $mod+Shift+8 move container to workspace 8
  180. bindsym $mod+Shift+9 move container to workspace 9
  181. bindsym $mod+Shift+0 move container to workspace 10
  182.  
  183. # reload the configuration file
  184. bindsym $mod+Shift+c reload
  185. # restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
  186. bindsym $mod+Shift+r restart
  187. # exit i3 (logs you out of your X session)
  188. bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
  189.  
  190. # resize window (you can also use the mouse for that)
  191. mode "resize" {
  192.         # These bindings trigger as soon as you enter the resize mode
  193.  
  194.         # Pressing left will shrink the window’s width.
  195.         # Pressing right will grow the window’s width.
  196.         # Pressing up will shrink the window’s height.
  197.         # Pressing down will grow the window’s height.
  198.         bindsym j resize shrink width 10 px or 10 ppt
  199.         bindsym k resize grow height 10 px or 10 ppt
  200.         bindsym l resize shrink height 10 px or 10 ppt
  201.         bindsym ccedilla resize grow width 10 px or 10 ppt
  202.  
  203.         # same bindings, but for the arrow keys
  204.         bindsym Left resize shrink width 10 px or 10 ppt
  205.         bindsym Down resize grow height 10 px or 10 ppt
  206.         bindsym Up resize shrink height 10 px or 10 ppt
  207.         bindsym Right resize grow width 10 px or 10 ppt
  208.  
  209.         # back to normal: Enter or Escape
  210.         bindsym Return mode "default"
  211.         bindsym Escape mode "default"
  212. }
  213.  
  214. bindsym $mod+r mode "resize"
  215.  
  216. # Start i3bar to display a workspace bar (plus the system information i3status
  217. # finds out, if available)
  218. bar {
  219.     #status_command i3status
  220.     status_command i3blocks -c ~/.config/i3/i3blocks.conf
  221.     position top
  222.     #position bottom
  223.     #wheel_up_cmd nop
  224.     #wheel_down_cmd nop
  225.     font pango:Terminus,Icons 11.5
  226.     #font pango:Fantasque Sans Mono 11
  227.     #font pango:Roboto Mono for Powerline 11
  228.     #separator_symbol "."
  229.     colors {
  230.         separator #6E6E6E
  231.         background #161616
  232.         statusline #FFFFFF
  233.        # class              border  backgrd text
  234.                focused_workspace  #83FF93 #222222 #eeeeee
  235.                active_workspace   #565656 #444444 #eeeeee
  236.                inactive_workspace #FF6363 #222222 #bbbbbb
  237.                urgent_workspace   #7E1919 #770000 #eeeeee
  238.     }
  239. }
  240.  
  241. # Theme colors
  242. #class                  border   backgr.  text  indicator
  243. client.focused          #7f8f9f #C0C0C0 #000000 #cad0c4
  244. client.focused_inactive #000000 #161616 #2D2D2D
  245. client.unfocused        #000000 #161616 #605e56
  246. client.urgent           #a5a5a5 #a5a5a5 #1E1E1E
  247. client.background       #161616
  248.  
  249. # Aplicações Iniciadas junto com o sistema
  250. #exec --no-startup-id
  251. #exec --no-startup-id
  252. exec --no-startup-id nitrogen --restore
  253. exec --no-startup-id compton &
  254. #exec --no-startup-id nm-applet &
  255. #exec --no-startup-id conky --pause 5
  256. #exec --no-startup-id mpd
  257.  
  258. # Aplições abertar em modo Floating
  259. for_window [class="Nitrogen"] floating enable sticky enable border normal
  260.  
  261. #Volume Control
  262. bindsym $mod+F11 exec amixer set Master 5%-
  263. bindsym $mod+F12 exec amixer set Master 5%+
  264.  
  265. #Brightness Control
  266. bindsym $mod+F5 exec xbacklight -dec 10
  267. bindsym $mod+F6 exec xbacklight -inc 10
  268.  
  269.  
  270. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  271.  
  272.  
  273.  
  274. align=center
  275. separator=false
  276. separator_block_width=10
  277. markup=pango
  278. command=$HOME/.config/i3//$BLOCK_NAME
  279.  
  280. #[separator]
  281.  
  282. [Info]
  283. label=
  284. command=echo -e Arch Linux
  285. interval=30
  286. color=#5555FF
  287.  
  288. [Kernel]
  289. label=
  290. command=uname -r
  291. color=#FFFFFF
  292. interval=once
  293.  
  294. [Tempo]
  295. full_text=
  296. interval=1800
  297. color=#7BE8FF
  298.  
  299. [disk-home]
  300. label=:
  301. command=/usr/lib/i3blocks/disk $HOME
  302. interval=30
  303. color=#859900
  304.  
  305. [ip]
  306. label=
  307. instance=enp0s3
  308. command=/usr/lib/i3blocks/iface
  309. color=#FF0000
  310. interval=1
  311.  
  312. [Mem]
  313. label=
  314. command=echo -e " `free -mh | awk '/^Mem/ {print $3}'` used"  
  315. interval=10
  316. color=#CCCCCC
  317.  
  318. [load]
  319. label=
  320. command=/usr/lib/i3blocks/load_average
  321. interval=10
  322. color=#6c71c4
  323.  
  324. [volume]
  325. label=
  326. command=/usr/lib/i3blocks/volume
  327. interval=1
  328. signal=10
  329. color=#4EFF00
  330.  
  331. [time]
  332. label=
  333. command=date '+%a %d-%m-%y  %T'
  334. interval=1
  335. color=#50C878
  336.  
  337. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  338.  
  339.  
  340.  
  341. #!/usr/bin/env bash
  342.  
  343. ################################
  344. # Shows info about the weather (in Cincinnati) from accuweather.com
  345. #
  346. # TODO: completely rewrite, probably using openweather APIs
  347. # TODO: make location configurable
  348. # TODO: make temperature unit configurable
  349. #
  350. # @return {Number(degrees Fahrenheit)}: Current temperature in Cincinnati
  351. ################################
  352.  
  353. dir=$(dirname $0)
  354. source $dir/util.sh
  355.  
  356. full=""
  357. short=""
  358. color=""
  359. status=0
  360.  
  361.  
  362. URL='http://www.accuweather.com/en/br/sao-paulo/45881/weather-forecast/45881'
  363. SITE="$(curl -s "$URL")"
  364.  
  365. weather="$(echo "$SITE" | awk -F\' '/acm_RecentLocationsCarousel\.push/{print $14 }'| head -1)"
  366. temp="$(echo "$SITE" | awk -F\' '/acm_RecentLocationsCarousel\.push/{print $12"°" }'| head -1)"
  367.  
  368.  
  369. if [[ $weather == *thunder* || $weather == *Thunder* ]]; then
  370.     icon=""
  371. else
  372.     if [[ $weather == *rain* || $weather == *Rain* ]]; then
  373.         icon=""
  374.     else
  375.         if [[ $weather == *cloud* || $weather == *Cloud* ]]; then
  376.             icon=""
  377.         else
  378.             icon=""
  379.         fi
  380.     fi
  381. fi
  382.  
  383.  
  384. full="$icon $temp"
  385. short="$temp"
  386.  
  387.  
  388. echo $full
  389. echo $short
  390. echo $color
  391. exit $status
  392.  
  393. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  394.  
  395.  
  396.  
  397. ################################
  398. # Calculates a given expression
  399. #
  400. # Dependencies:
  401. # - bc
  402. #
  403. # @param {String} 1: The expression to calculate
  404. # @return {Number}: The result of the expression
  405. ################################
  406. calc() {
  407.     echo "$1" | bc
  408. }
  409.  
  410.  
  411. ################################
  412. # Counts lines in text, accounting for empty values
  413. #
  414. # @param {String} 1: The input text
  415. # @return {Number}: The number of lines
  416. ################################
  417. numLines() {
  418.     if [[ $1 == "" ]]; then
  419.         echo 0
  420.     else
  421.         echo "$1" | wc -l
  422.     fi
  423. }
Advertisement
Add Comment
Please, Sign In to add comment