Advertisement
Guest User

polybar (i3wm) + scripts

a guest
Aug 2nd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.53 KB | None | 0 0
  1. #####################################################
  2. # #
  3. # To learn more about how to configure Polybar #
  4. # go to https://github.com/jaagr/polybar #
  5. # #
  6. # The README contains alot of information #
  7. # #
  8. #####################################################
  9.  
  10.  
  11. #########################
  12. # GENERAL #
  13. #########################
  14. [settings]
  15. screenchange-reload = true
  16. ;compositing-background = xor
  17. ;compositing-background = screen
  18. ;compositing-foreground = source
  19. ;compositing-border = over
  20.  
  21.  
  22. [global/wm]
  23. margin-top = 0
  24. margin-bottom = 0
  25. ;vim:ft=dosini
  26.  
  27.  
  28. #########################
  29. # COLORS #
  30. #########################
  31. [colors]
  32. background = #303d44
  33. background-alt = #4f6571
  34. foreground = #eeeeee
  35. foreground-alt = #4f6571
  36. transparent = #00ffffff
  37. alert = #d8d782
  38.  
  39.  
  40. #########################
  41. # BAR/TOP #
  42. #########################
  43. [bar/top]
  44. locale = sk_SK.UTF-8
  45. monitor = ${env:MONITOR:DVI-I-1}
  46. monitor-fallback = HDMI-0
  47. monitor-strict = false
  48. ;fixed-center = true
  49. ;wm-restack = i3
  50. ;override-redirect = true
  51. ;enable-ipc = true
  52. width = 100%
  53. height = 21
  54. ;offset-x = 0
  55. ;offset-y = 0
  56. ;radius = 6.0
  57.  
  58. background = ${colors.background}
  59. foreground = ${colors.foreground}
  60. line-size = 0
  61. line-color = #303d44
  62. border-size = 4
  63. border-color = #00000000
  64. padding-left = 0
  65. padding-right = 0
  66.  
  67. module-margin-left = 0
  68. module-margin-right = 0
  69. modules-left = i3
  70. modules-center =
  71. modules-right = volume root home trash packages cpu temperature memory date powermenu
  72.  
  73. font-0 = Hack:weight=Regular:pixelsize=11;2
  74. font-1 = Hack:weight=Regular:size=10:antialias=false;0
  75. font-2 = Hack:weight=Regular:pixelsize=14;2
  76. font-3 = FontAwesome:pixelsize=11;2
  77.  
  78. tray-position = right
  79. tray-padding = 2
  80. tray-detached = false
  81. ;tray-transparent = true
  82. ;tray-background = #4f6571
  83.  
  84. click-left = gsimplecal
  85. click-right = exo-open --launch TerminalEmulator
  86. click-middle = rofi -show run -sidebar-mode
  87. scroll-up = i3wm-wsnext
  88. scroll-down = i3wm-wsprev
  89. double-click-left =
  90. double-click-middle =
  91. double-click-right =
  92.  
  93.  
  94. #########################
  95. # FILESYSTEM #
  96. #########################
  97. [module/filesystem]
  98. type = internal/fs
  99. interval = 10
  100. format-mounted = <label-mounted>
  101. mount-0 = /
  102. ;mount-1 = /home
  103. label-padding = 0
  104. label-mounted = "  %free% "
  105. label-mounted-background = ${colors.background}
  106. label-mounted-foreground = ${colors.foreground}
  107. label-unmounted = %mountpoint% not mounted
  108. label-unmounted-foreground = ${colors.background}
  109. format-mounted-prefix-font = 3
  110. format-mounted-suffix-font = 3
  111. format-mounted-prefix-padding = 0
  112. format-mounted-suffix-padding = 0
  113. format-mounted-suffix = 
  114. format-mounted-suffix-background = ${colors.background}
  115. format-mounted-suffix-foreground = ${colors.background-alt}
  116.  
  117.  
  118. [module/root]
  119. type = custom/script
  120. interval = 1
  121. format = <label>
  122. format-suffix-font = 3
  123. format-suffix-padding = 0
  124. format-suffix = 
  125. format-suffix-background = ${colors.background}
  126. format-suffix-foreground = ${colors.background-alt}
  127. label-background = ${colors.background}
  128. label-foreground = ${colors.foreground}
  129. exec = ~/.config/polybar/root
  130. click-left = pcmanfm -n /
  131.  
  132.  
  133. [module/home]
  134. type = custom/script
  135. interval = 1
  136. format = <label>
  137. format-suffix-font = 3
  138. format-suffix-padding = 0
  139. format-suffix = 
  140. format-suffix-background = ${colors.background-alt}
  141. format-suffix-foreground = ${colors.background}
  142. label-background = ${colors.background-alt}
  143. label-foreground = ${colors.foreground}
  144. exec = ~/.config/polybar/home
  145. click-left = pcmanfm -n $HOME
  146.  
  147.  
  148. [module/trash]
  149. type = custom/script
  150. interval = 1
  151. exec = ~/.config/polybar/trash
  152. format-suffix-font = 3
  153. format-prefix = "  "
  154. format-prefix-background = ${colors.background}
  155. format-prefix-foreground = ${colors.foreground}
  156. format-suffix = " "
  157. format-suffix-background = ${colors.background}
  158. format-suffix-foreground = ${colors.background-alt}
  159. format-prefix-padding-left = 0
  160. format-prefix-padding-right = 0
  161. label-background = ${colors.background}
  162. label-foreground = ${colors.foreground}
  163. label-padding = 0
  164. click-left = pcmanfm -n ~/.local/share/Trash/files
  165. click-right = rm -rf ~/.local/share/Trash/files/* ;exec notify-send 'Kôš vyprázdnený'"
  166.  
  167.  
  168. #########################
  169. # i3WM #
  170. #########################
  171. [module/i3]
  172. type = internal/i3
  173. format = <label-state> <label-mode>
  174. index-sort = true
  175. wrapping-scroll = true
  176. fuzzy-match = false
  177. strip-wsnumbers = true
  178. pin-workspaces = false
  179. reverse-scroll = true
  180.  
  181. ; focused = Active workspace on focused monitor
  182. label-focused = %icon%
  183. label-focused-background = ${colors.background-alt}
  184. label-focused-foreground = ${colors.foreground}
  185. label-focused-padding = 1
  186.  
  187. ; unfocused = Inactive workspace on any monitor
  188. label-unfocused = %icon%
  189. label-unfocused-background = ${colors.background}
  190. label-unfocused-foreground = ${colors.foreground}
  191. label-unfocused-padding = 1
  192.  
  193. ; visible = Active workspace on unfocused monitor
  194. label-visible = %icon%
  195. label-visible-background = ${colors.background-alt}
  196. label-visible-foreground = ${colors.background}
  197. label-visible-padding = 1
  198.  
  199. ; urgent = Workspace with urgency hint set
  200. label-urgent = %icon%
  201. label-urgent-background = ${colors.background}
  202. label-urgent-foreground = ${colors.alert}
  203. label-urgent-padding = 1
  204.  
  205. ; ws-icon-[0-9]+ = label;icon
  206. ; ; NOTE: The label needs to match the name of the i3 workspace
  207. ws-icon-0 = 1:;
  208. ws-icon-1 = 2:;
  209. ws-icon-2 = 3:;
  210. ws-icon-3 = 4:;
  211. ws-icon-4 = 5:;
  212. ws-icon-5 = 6:;
  213. ws-icon-6 = 7:;
  214. ws-icon-7 = 8:;
  215. ws-icon-8 = 9:;
  216. ws-icon-9 = 10:;
  217. ws-icon-10 = 11:;
  218. ws-icon-11 = 12:;
  219. ws-icon-default = 
  220.  
  221.  
  222. #########################
  223. # CPU #
  224. #########################
  225. [module/cpu]
  226. type = internal/cpu
  227. interval = 0.5
  228. format = <label>
  229. format-suffix-font = 3
  230. format-suffix = " "
  231. format-suffix-background = ${colors.background}
  232. format-suffix-foreground = ${colors.background-alt}
  233. label = "  %percentage%%"
  234. label-background = ${colors.background}
  235. label-foreground = ${colors.foreground}
  236. label-padding = 0
  237.  
  238.  
  239. #########################
  240. # TEMPERATURE #
  241. #########################
  242. [module/temperature]
  243. type = internal/temperature
  244. thermal-zone = 0
  245. interval = 10
  246. warn-temperature = 60
  247. format = <label>
  248. format-suffix = " "
  249. format-suffix-background = ${colors.background-alt}
  250. format-suffix-foreground = ${colors.background}
  251. format-suffix-font =3
  252. format-warn = <label-warn>
  253. label = "  %temperature%"
  254. label-padding = 0
  255. label-background = ${colors.background-alt}
  256. label-foreground = ${colors.foreground}
  257. label-warn = "  %temperature%"
  258. label-warn-foreground = #ad8b85
  259.  
  260.  
  261. #########################
  262. # MEMORY #
  263. #########################
  264. [module/memory]
  265. type = internal/memory
  266. interval = 0.5
  267. format-suffix = " "
  268. format-suffix-background = ${colors.background}
  269. format-suffix-foreground = ${colors.background-alt}
  270. format-suffix-font =3
  271. label = "  %percentage_used%%"
  272. label-background = ${colors.background}
  273. label-foreground = ${colors.foreground}
  274. label-padding = 0
  275.  
  276.  
  277. #########################
  278. # DATE #
  279. #########################
  280. [module/date]
  281. type = internal/date
  282. interval = 1
  283. date =
  284. date-alt = " %a * %d.%m.%Y"
  285. time = %H:%M
  286. time-alt = %H:%M
  287. format-suffix-font = 3
  288. format-suffix = " "
  289. format-suffix-foreground = ${colors.background}
  290. format-background = ${colors.background-alt}
  291. format-foreground = ${colors.foreground}
  292. label = %date%  %time%
  293. label-padding = 0
  294.  
  295.  
  296. #########################
  297. # VOLUME #
  298. #########################
  299. [module/volume]
  300. type = internal/volume
  301. format-volume = <ramp-volume><label-volume>
  302. format-muted = <label-muted>
  303. label-volume = %percentage%%
  304. label-volume-background = ${colors.background-alt}
  305. label-volume-foreground = ${colors.foreground}
  306. label-muted = "  muted"
  307. label-muted-background = ${colors.background-alt}
  308. label-muted-foreground = ${colors.foreground}
  309. format-volume-padding = 0
  310. format-muted-padding = 0
  311. format-volume-prefix-font = 3
  312. format-volume-prefix = 
  313. format-volume-prefix-background = ${colors.background}
  314. format-volume-prefix-foreground = ${colors.background-alt}
  315. format-volume-suffix-font = 3
  316. format-volume-suffix = " "
  317. format-volume-suffix-background = ${colors.background-alt}
  318. format-volume-suffix-foreground = ${colors.background}
  319. format-muted-prefix-font = 3
  320. format-muted-prefix = 
  321. format-muted-prefix-background = ${colors.background}
  322. format-muted-prefix-foreground = ${colors.background-alt}
  323. format-muted-suffix-font = 3
  324. format-muted-suffix = " "
  325. format-muted-suffix-background = ${colors.background-alt}
  326. format-muted-suffix-foreground = ${colors.background}
  327. ramp-volume-0 = "  "
  328. ramp-volume-1 = "  "
  329. ramp-volume-2 = "  "
  330. ramp-volume-3 = "  "
  331. ramp-volume-4 = "  "
  332. ramp-volume-5 = "  "
  333. ramp-volume-6 = "  "
  334. ramp-headphones-0 = "  "
  335. ramp-volume-0-background = ${colors.background-alt}
  336. ramp-volume-0-foreground = ${colors.foreground}
  337. ramp-volume-1-background = ${colors.background-alt}
  338. ramp-volume-1-foreground = ${colors.foreground}
  339. ramp-volume-2-background = ${colors.background-alt}
  340. ramp-volume-2-foreground = ${colors.foreground}
  341. ramp-volume-3-background = ${colors.background-alt}
  342. ramp-volume-3-foreground = ${colors.foreground}
  343. ramp-volume-4-background = ${colors.background-alt}
  344. ramp-volume-4-foreground = ${colors.foreground}
  345. ramp-volume-5-background = ${colors.background-alt}
  346. ramp-volume-5-foreground = ${colors.foreground}
  347. ramp-volume-6-background = ${colors.background-alt}
  348. ramp-volume-6-foreground = ${colors.foreground}
  349. ramp-headphones-0-background = ${colors.foreground}
  350. ramp-headphones-0-foreground = ${colors.background-alt}
  351. ramp-volume-0-padding-left = 0
  352. ramp-volume-0-padding-right = 0
  353. ramp-volume-1-padding-left = 0
  354. ramp-volume-1-padding-right = 0
  355. ramp-volume-2-padding-left = 0
  356. ramp-volume-2-padding-right = 0
  357. ramp-volume-3-padding-left = 0
  358. ramp-volume-3-padding-right = 0
  359. ramp-volume-4-padding-left = 0
  360. ramp-volume-4-padding-right = 0
  361. ramp-volume-5-padding-left = 0
  362. ramp-volume-5-padding-right = 0
  363. ramp-volume-6-padding-left = 0
  364. ramp-volume-6-padding-right = 0
  365. ramp-headphones-0-padding-left = 0
  366. ramp-headphones-0-padding-right = 0
  367.  
  368.  
  369. #########################
  370. # PACKAGES #
  371. #########################
  372. [module/packages]
  373. type = custom/script
  374. interval = 1
  375. format = <label>
  376. format-suffix-font = 3
  377. format-suffix-padding = 0
  378. format-suffix = 
  379. format-suffix-background = ${colors.background-alt}
  380. format-suffix-foreground = ${colors.background}
  381. label-background = ${colors.background-alt}
  382. label-foreground = ${colors.foreground}
  383. exec = ~/.config/polybar/packages
  384. click-left = pamac-updater
  385. click-right = pamac-manager
  386. click-middle = octopi
  387.  
  388.  
  389. #########################
  390. # POWERMENU #
  391. #########################
  392. [module/powermenu]
  393. type = custom/menu
  394. format-spacing = 1
  395. label-open = 
  396. label-open-padding = 1
  397. label-open-foreground = ${colors.foreground}
  398. label-close = 
  399. label-close-foreground = ${colors.alert}
  400. ;label-separator = |
  401. ;label-separator-foreground = ${colors.foreground-alt}
  402.  
  403. menu-0-0 = " "
  404. menu-0-0-exec = shutdown -r now
  405. menu-0-1 = " "
  406. menu-0-1-exec = shutdown -h now
  407.  
  408. ;menu-0-0 = " "
  409. ;menu-0-0-exec = menu-open-1
  410. ;menu-0-1 = " "
  411. ;menu-0-1-exec = menu-open-2
  412. ;menu-1-0 = 
  413. ;menu-1-0-exec = menu-open-0
  414. ;menu-1-1 = 
  415. ;menu-1-1-exec = shutdown -r now
  416. ;menu-2-0 = 
  417. ;menu-2-0-exec = shutdown -h now
  418. ;menu-2-1 = 
  419. ;menu-2-1-exec = menu-open-0
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426. ROOT:
  427. #!/bin/bash
  428.  
  429. DIR=$(df -h / | grep dev | awk -F ' ' '{ print $4 }' | sed 's/\G//')
  430.  
  431. if [[ "${DIR}" ]]; then
  432. echo "  ${DIR} GB "
  433. fi
  434.  
  435.  
  436.  
  437. HOME:
  438. #!/bin/bash
  439.  
  440. DIR=$(df -h /home | grep dev | awk -F ' ' '{ print $4 }' | sed 's/\G//')
  441.  
  442. if [[ "${DIR}" ]]; then
  443. echo "  ${DIR} GB "
  444. fi
  445.  
  446.  
  447.  
  448. TRASH:
  449. #!/bin/bash
  450.  
  451. TRASH_DIRECTORY="${BLOCK_INSTANCE}"
  452.  
  453. if [[ "${TRASH_DIRECTORY}" = "" ]]; then
  454. TRASH_DIRECTORY="${XDG_DATA_HOME:-${HOME}/.local/share}/Trash"
  455. fi
  456.  
  457. # Left click
  458. if [[ "${BLOCK_BUTTON}" -eq 1 ]]; then
  459. xdg-open "${TRASH_DIRECTORY}/files"
  460. # Right click
  461. elif [[ "${BLOCK_BUTTON}" -eq 3 ]]; then
  462. # Delete all files permanently (unlink them)
  463. rm -r "${TRASH_DIRECTORY}/files"
  464. rm -r "${TRASH_DIRECTORY}/info"
  465. exec paplay ~/.sounds/freedesktop/stereo/trash-empty.oga
  466. # Create new directory
  467. mkdir "${TRASH_DIRECTORY}/files"
  468. mkdir "${TRASH_DIRECTORY}/info"
  469. fi
  470.  
  471. TRASH_COUNT=$(ls -A -U -1 "${TRASH_DIRECTORY}/files" | wc -l)
  472.  
  473. echo "${TRASH_COUNT}"
  474.  
  475.  
  476.  
  477. PACKAGES:
  478. #!/usr/bin/bash
  479.  
  480. PACKAGE_COUNT=$(pacman -Q | wc -l)
  481.  
  482. if [[ "${PACKAGE_COUNT}" -gt 0 ]]; then
  483. echo "  ${PACKAGE_COUNT} "
  484. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement