Advertisement
Guest User

Untitled

a guest
Nov 5th, 2016
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 70.30 KB | None | 0 0
  1. -- Standard awesome library
  2. local gears = require("gears")
  3. local awful = require("awful")
  4. awful.rules = require("awful.rules")
  5. require("awful.autofocus")
  6. -- Widget and layout library
  7. local wibox = require("wibox")
  8. -------------------------------------------------------------------------------
  9. vicious = require("vicious")
  10. -- obvious = require("obvious")
  11. -------------------------------------------------------------------------------
  12. -- Theme handling library
  13. local beautiful = require("beautiful")
  14. -- Notification library
  15. local naughty = require("naughty")
  16. -------------------------------------------------------------------------------
  17. naughty.config.defaults.position = "top_right"
  18. naughty.config.defaults.fg = '#000000'
  19. naughty.config.defaults.bg = '#00ffff'
  20. -------------------------------------------------------------------------------
  21. local menubar = require("menubar")
  22.  
  23. -- Load Debian menu entries
  24. require("debian.menu")
  25.  
  26. -- {{{ Error handling
  27. -- Check if awesome encountered an error during startup and fell back to
  28. -- another config (This code will only ever execute for the fallback config)
  29. if awesome.startup_errors then
  30. naughty.notify({ preset = naughty.config.presets.critical,
  31. title = "Oops, there were errors during startup!",
  32. text = awesome.startup_errors })
  33. end
  34.  
  35. -- Handle runtime errors after startup
  36. do
  37. local in_error = false
  38. awesome.connect_signal("debug::error", function (err)
  39. -- Make sure we don't go into an endless error loop
  40. if in_error then return end
  41. in_error = true
  42.  
  43. naughty.notify({ preset = naughty.config.presets.critical,
  44. title = "Oops, an error happened!",
  45. text = err })
  46. in_error = false
  47. end)
  48. end
  49. -- }}}
  50.  
  51. -- {{{ Variable definitions
  52. -- Themes define colours, icons, font and wallpapers.
  53. -------------------------------------------------------------------------------
  54. -- beautiful.init("/usr/share/awesome/themes/default/theme.lua")
  55. home = os.getenv("HOME")
  56. user = os.getenv("USER")
  57. beautiful.init(home .. "/.config/awesome/themes/piyavking/theme.lua")
  58. -------------------------------------------------------------------------------
  59.  
  60. -- This is used later as the default terminal and editor to run.
  61. terminal = "x-terminal-emulator"
  62. editor = os.getenv("EDITOR") or "editor"
  63. editor_cmd = terminal .. " -e " .. editor
  64.  
  65. -- Default modkey.
  66. -- Usually, Mod4 is the key with a logo between Control and Alt.
  67. -- If you do not like this or do not have such a key,
  68. -- I suggest you to remap Mod4 to another key using xmodmap or other tools.
  69. -- However, you can use another modifier like Mod1, but it may interact with others.
  70. modkey = "Mod4"
  71.  
  72. -- Table of layouts to cover with awful.layout.inc, order matters.
  73. local layouts =
  74. {
  75. awful.layout.suit.floating,
  76. awful.layout.suit.tile,
  77. awful.layout.suit.tile.left,
  78. awful.layout.suit.tile.bottom,
  79. awful.layout.suit.tile.top,
  80. awful.layout.suit.fair,
  81. awful.layout.suit.fair.horizontal,
  82. awful.layout.suit.spiral,
  83. awful.layout.suit.spiral.dwindle,
  84. awful.layout.suit.max,
  85. awful.layout.suit.max.fullscreen,
  86. awful.layout.suit.magnifier
  87. }
  88. -- }}}
  89.  
  90. -- {{{ Wallpaper
  91. -- if beautiful.wallpaper then
  92. -- for s = 1, screen.count() do
  93. -- gears.wallpaper.maximized(beautiful.wallpaper, s, true)
  94. -- end
  95. -- end
  96. -- }}}
  97.  
  98. -- {{{ Tags
  99. -- Define a tag table which hold all screen tags.
  100. -- tags = {}
  101. -- for s = 1, screen.count() do
  102. -- Each screen has its own tag table.
  103. -- tags[s] = awful.tag({ 1, 2, 3, 4, 5, 6, 7, 8, 9 }, s, layouts[1])
  104. -- end
  105. -------------------------------------------------------------------------------
  106. tags = {
  107. names = {" ⠐ ", " ⠡ ", " ⠪ ", " ⠵ ", " ⠻ ", " ⠿ ",},
  108. }
  109. for s = 1, screen.count() do
  110. tags[s] = awful.tag(tags.names, s, {layouts[4], layouts[1], layouts[2], layouts[4], layouts[4], layouts[4]})
  111. end
  112. -------------------------------------------------------------------------------
  113. -- }}}
  114.  
  115. -- {{{ Menu
  116. -- Create a laucher widget and a main menu
  117. myawesomemenu = {
  118. { "manual", terminal .. " -e man awesome" },
  119. { "edit config", editor_cmd .. " " .. awesome.conffile },
  120. { "restart", awesome.restart },
  121. { "quit", awesome.quit }
  122. }
  123. mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
  124. { "Debian", debian.menu.Debian_menu.Debian },
  125. { "open terminal", terminal }
  126. }, theme = { width = 200, height = 20 }
  127. })
  128.  
  129.  
  130.  
  131. mylauncher = wibox.layout.margin(awful.widget.launcher({ image = beautiful.awesome_icon,
  132. menu = mymainmenu }), 0, 5, 0, 0 )
  133.  
  134.  
  135. -------------------------------------------------------------------------------
  136. FL_launcher = awful.widget.launcher({ image = home .. '/.local/share/icons/FL.png', command = "FL.sh" })
  137. FL_launcher = wibox.layout.constraint(FL_launcher, "exact", 50, nil)
  138. FL_launcher = wibox.layout.margin(FL_launcher, 10, 10, 10, 10 )
  139.  
  140. GR_launcher = awful.widget.launcher({ image = home .. '/.local/share/icons/gr5.png', command = "guitar_rig.sh" })
  141. GR_launcher = wibox.layout.constraint(GR_launcher, "exact", 50, nil)
  142. GR_launcher = wibox.layout.margin(GR_launcher, 10, 10, 10, 10 )
  143.  
  144. qjackctl_launcher = awful.widget.launcher({ image = '/usr/share/pixmaps/qjackctl.xpm', command = "qjackctl" })
  145. qjackctl_launcher = wibox.layout.constraint(qjackctl_launcher, "exact", 50, nil)
  146. qjackctl_launcher = wibox.layout.margin(qjackctl_launcher, 10, 10, 10, 10 )
  147.  
  148. jmixer_launcher = awful.widget.launcher({ image = '/usr/share/icons/hicolor/48x48/apps/jack_mixer.png', command = "jack_mixer" })
  149. jmixer_launcher = wibox.layout.constraint(jmixer_launcher, "exact", 50, nil)
  150. jmixer_launcher = wibox.layout.margin(jmixer_launcher, 10, 10, 10, 10 )
  151.  
  152. pavucontrol_launcher = awful.widget.launcher({ image = '/usr/share/icons/gnome/48x48/apps/multimedia-volume-control.png', command = "pavucontrol" })
  153. pavucontrol_launcher = wibox.layout.constraint(pavucontrol_launcher, "exact", 50, nil)
  154. pavucontrol_launcher = wibox.layout.margin(pavucontrol_launcher, 10, 10, 10, 10 )
  155.  
  156. audacity_launcher = awful.widget.launcher({ image = '/usr/share/icons/hicolor/48x48/apps/audacity.png', command = "env PULSE_LATENCY_MSEC=30 audacity" })
  157. audacity_launcher = wibox.layout.constraint(audacity_launcher, "exact", 50, nil)
  158. audacity_launcher = wibox.layout.margin(audacity_launcher, 10, 10, 10, 10 )
  159.  
  160. --avidemux_launcher = awful.widget.launcher({ image = '/usr/share/icons/hicolor/48x48/apps/avidemux.png', command = "env PULSE_LATENCY_MSEC=30 avidemux" })
  161. --avidemux_launcher = wibox.layout.constraint(avidemux_launcher, "exact", 50, nil)
  162. --avidemux_launcher = wibox.layout.margin(avidemux_launcher, 10, 10, 10, 10 )
  163.  
  164. gimp_launcher = awful.widget.launcher({ image = '/usr/share/icons/hicolor/48x48/apps/gimp.png', command = "gimp" })
  165. gimp_launcher = wibox.layout.constraint(gimp_launcher, "exact", 50, nil)
  166. gimp_launcher = wibox.layout.margin(gimp_launcher, 10, 10, 10, 10 )
  167.  
  168. handbrake_launcher = awful.widget.launcher({ image = '/usr/share/icons/hicolor/scalable/apps/hb-icon.svg', command = "handbrake-gtk" })
  169. handbrake_launcher = wibox.layout.constraint(handbrake_launcher, "exact", 50, nil)
  170. handbrake_launcher = wibox.layout.margin(handbrake_launcher, 10, 10, 10, 10 )
  171.  
  172. blood_launcher = awful.widget.launcher({ image = home .. '/.local/share/icons/blood.png', command = "dosbox " .. home .. "/.dosbox/blood/blood.exe -fullscreen -exit" })
  173. blood_launcher = wibox.layout.constraint(blood_launcher, "exact", 50, nil)
  174. blood_launcher = wibox.layout.margin(blood_launcher, 10, 10, 10, 10 )
  175.  
  176. cryptic_launcher = awful.widget.launcher({ image = home .. '/.local/share/icons/caleb.png', command = "dosbox " .. home .. "/.dosbox/blood/CRYPTIC.exe -fullscreen -exit" })
  177. cryptic_launcher = wibox.layout.constraint(cryptic_launcher, "exact", 50, nil)
  178. cryptic_launcher = wibox.layout.margin(cryptic_launcher, 10, 10, 10, 10 )
  179.  
  180. RR_launcher = awful.widget.launcher({ image = home .. '/.local/share/icons/RR.png', command = "dosbox " .. home .. "/.dosbox/RedNeck/rr/RR.EXE -fullscreen -exit" })
  181. RR_launcher = wibox.layout.constraint(RR_launcher, "exact", 50, nil)
  182. RR_launcher = wibox.layout.margin(RR_launcher, 10, 10, 10, 10 )
  183.  
  184. RA_launcher = awful.widget.launcher({ image = home .. '/.local/share/icons/RRRA.png', command = "dosbox " .. home .. "/.dosbox/RedNeck/rrra/RA.EXE -fullscreen -exit" })
  185. RA_launcher = wibox.layout.constraint(RA_launcher, "exact", 50, nil)
  186. RA_launcher = wibox.layout.margin(RA_launcher, 10, 10, 10, 10 )
  187.  
  188. Route66_launcher = awful.widget.launcher({ image = home .. '/.local/share/icons/ROUTE66.png', command = "dosbox " .. home .. "/.dosbox/RedNeck/rrsgr66/ROUTE66.EXE -fullscreen -exit" })
  189. Route66_launcher = wibox.layout.constraint(Route66_launcher, "exact", 50, nil)
  190. Route66_launcher = wibox.layout.margin(Route66_launcher, 10, 10, 10, 10 )
  191.  
  192. hexen1_launcher = awful.widget.launcher({ image = home .. '/.local/share/icons/Hexen-1-icon.png', command = "dosbox " .. home .. "/.dosbox/Hexendk/HEXEN.EXE -fullscreen -exit" })
  193. hexen1_launcher = wibox.layout.constraint(hexen1_launcher, "exact", 50, nil)
  194. hexen1_launcher = wibox.layout.margin(hexen1_launcher, 10, 10, 10, 10 )
  195.  
  196. hexen2_launcher = awful.widget.launcher({ image = home .. '/.local/share/icons/Hexen-1-icon.png', command = "dosbox " .. home .. "/.dosbox/Hexendk/HEXENDK.EXE -fullscreen -exit" })
  197. hexen2_launcher = wibox.layout.constraint(hexen2_launcher, "exact", 50, nil)
  198. hexen2_launcher = wibox.layout.margin(hexen2_launcher, 10, 10, 10, 10 )
  199.  
  200. pacman_launcher = awful.widget.launcher({ image = home .. '/.local/share/icons/Pacman.ico', command = "fceux " .. home .. "/.fceux/roms/Pac-Man.nes" })
  201. pacman_launcher = wibox.layout.constraint(pacman_launcher, "exact", 50, nil)
  202. pacman_launcher = wibox.layout.margin(pacman_launcher, 10, 10, 10, 10 )
  203.  
  204. pacmania_launcher = awful.widget.launcher({ image = home .. '/.local/share/icons/Pac-Mania.ico', command = "fceux " .. home .. "/.fceux/roms/Pac-Mania.nes" })
  205. pacmania_launcher = wibox.layout.constraint(pacmania_launcher, "exact", 50, nil)
  206. pacmania_launcher = wibox.layout.margin(pacmania_launcher, 10, 10, 10, 10 )
  207.  
  208. abadox_launcher = awful.widget.launcher({ image = home .. '/.local/share/icons/Pac-Mania.ico', command = "fceux " .. home .. "/.fceux/roms/Abadox.nes" })
  209. abadox_launcher = wibox.layout.constraint(abadox_launcher, "exact", 50, nil)
  210. abadox_launcher = wibox.layout.margin(abadox_launcher, 10, 10, 10, 10 )
  211.  
  212. manhunt_launcher = awful.widget.launcher({ image = home .. '/.local/share/icons/manhunt.png', command = "manhunt.sh" })
  213. manhunt_launcher = wibox.layout.constraint(manhunt_launcher, "exact", 50, nil)
  214. manhunt_launcher = wibox.layout.margin(manhunt_launcher, 10, 10, 10, 10 )
  215.  
  216. seamonkey_launcher = awful.widget.launcher({ image = '/opt/seamonkey/chrome/icons/default/seamonkey.png', command = 'env LD_PRELOAD=/home/piyavking/fullscreenhack-master/libfshack-npapi.so seamonkey' })
  217. seamonkey_launcher = wibox.layout.constraint(seamonkey_launcher, "exact", 50, nil)
  218. seamonkey_launcher = wibox.layout.margin(seamonkey_launcher, 10, 10, 10, 10 )
  219.  
  220. gvim_launcher = awful.widget.launcher({ image = '/usr/share/icons/hicolor/48x48/apps/gvim.png', command = 'gvim' })
  221. gvim_launcher = wibox.layout.constraint(gvim_launcher, "exact", 50, nil)
  222. gvim_launcher = wibox.layout.margin(gvim_launcher, 10, 10, 10, 10 )
  223.  
  224. composer_launcher = awful.widget.launcher({ image = '/opt/seamonkey/chrome/icons/default/editorWindow48.png', command = 'seamonkey -editor' })
  225. composer_launcher = wibox.layout.constraint(composer_launcher, "exact", 50, nil)
  226. composer_launcher = wibox.layout.margin(composer_launcher, 10, 10, 10, 10 )
  227.  
  228. lowriter_launcher = awful.widget.launcher({ image = '/usr/share/icons/hicolor/48x48/apps/libreoffice-writer.png', command = 'lowriter' })
  229. lowriter_launcher = wibox.layout.constraint(lowriter_launcher, "exact", 50, nil)
  230. lowriter_launcher = wibox.layout.margin(lowriter_launcher, 10, 10, 10, 10 )
  231.  
  232. chromium_launcher = awful.widget.launcher({ image = '/usr/share/icons/hicolor/48x48/apps/chromium-browser.png', command = 'chromium-browser' })
  233. chromium_launcher = wibox.layout.constraint(chromium_launcher, "exact", 50, nil)
  234. chromium_launcher = wibox.layout.margin(chromium_launcher, 10, 10, 10, 10 )
  235.  
  236. seamonkey_mail_launcher = awful.widget.launcher({ image = '/opt/seamonkey/chrome/icons/default/messengerWindow48.png', command = 'env LD_PRELOAD=/home/piyavking/fullscreenhack-master/libfshack-npapi.so seamonkey -mail' })
  237. seamonkey_mail_launcher = wibox.layout.constraint(seamonkey_mail_launcher, "exact", 50, nil)
  238. seamonkey_mail_launcher = wibox.layout.margin(seamonkey_mail_launcher, 10, 10, 10, 10 )
  239.  
  240. pidgin_launcher = awful.widget.launcher({ image = '/usr/share/icons/hicolor/48x48/apps/pidgin.png', command = 'pidgin' })
  241. pidgin_launcher = wibox.layout.constraint(pidgin_launcher, "exact", 50, nil)
  242. pidgin_launcher = wibox.layout.margin(pidgin_launcher, 10, 10, 10, 10 )
  243.  
  244. skype_launcher = awful.widget.launcher({ image = '/usr/share/icons/hicolor/48x48/apps/skype.png', command = 'skype' })
  245. skype_launcher = wibox.layout.constraint(skype_launcher, "exact", 50, nil)
  246. skype_launcher = wibox.layout.margin(skype_launcher, 10, 10, 10, 10 )
  247.  
  248. smplayer_launcher = awful.widget.launcher({ image = '/usr/share/icons/hicolor/64x64/apps/smplayer.png', command = 'smplayer' })
  249. smplayer_launcher = wibox.layout.constraint(smplayer_launcher, "exact", 50, nil)
  250. smplayer_launcher = wibox.layout.margin(smplayer_launcher, 10, 10, 10, 10 )
  251.  
  252. smtube_launcher = awful.widget.launcher({ image = '/usr/share/icons/hicolor/64x64/apps/smtube.png', command = 'smtube' })
  253. smtube_launcher = wibox.layout.constraint(smtube_launcher, "exact", 50, nil)
  254. smtube_launcher = wibox.layout.margin(smtube_launcher, 10, 10, 10, 10 )
  255.  
  256. projectm_launcher = awful.widget.launcher({ image = '/usr/share/pixmaps/prjm16-transparent.svg', command = 'projectM-pulseaudio' })
  257. projectm_launcher = wibox.layout.constraint(projectm_launcher, "exact", 50, nil)
  258. projectm_launcher = wibox.layout.margin(projectm_launcher, 10, 10, 10, 10 )
  259.  
  260. mplaylist_launcher = awful.widget.launcher({ image = home .. '/.local/share/icons/mplayer.png', command = 'mplayer.sh -foldr' })
  261. mplaylist_launcher = wibox.layout.constraint(mplaylist_launcher, "exact", 50, nil)
  262. mplaylist_launcher = wibox.layout.margin(mplaylist_launcher, 10, 10, 10, 10 )
  263.  
  264. mplaylist_s_launcher = awful.widget.launcher({ image = home .. '/.local/share/icons/mplayer_s.png', command = 'mplayer.sh -s' })
  265. mplaylist_s_launcher = wibox.layout.constraint(mplaylist_s_launcher, "exact", 50, nil)
  266. mplaylist_s_launcher = wibox.layout.margin(mplaylist_s_launcher, 10, 10, 10, 10 )
  267.  
  268. urxvt_launcher = awful.widget.launcher({ image = home .. '/.local/share/icons/urxvt.png', command = 'urxvt.sh' })
  269. urxvt_launcher = wibox.layout.constraint(urxvt_launcher, "exact", 50, nil)
  270. urxvt_launcher = wibox.layout.margin(urxvt_launcher, 10, 10, 10, 10 )
  271.  
  272. tc_launcher = awful.widget.launcher({ image = home .. '/.local/share/icons/TC.png', command = 'tc.sh' })
  273. tc_launcher = wibox.layout.constraint(tc_launcher, "exact", 50, nil)
  274. tc_launcher = wibox.layout.margin(tc_launcher, 10, 10, 10, 10 )
  275.  
  276. nc_launcher = awful.widget.launcher({ image = home .. '/.local/share/icons/NC.png', command = 'dosbox ' .. home .. '/.dosbox/dosbox.bat -exit' })
  277. nc_launcher = wibox.layout.constraint(nc_launcher, "exact", 50, nil)
  278. nc_launcher = wibox.layout.margin(nc_launcher, 10, 10, 10, 10 )
  279.  
  280. gparted_launcher = awful.widget.launcher({ image = '/usr/share/icons/hicolor/48x48/apps/gparted.png', command = 'sudo gparted' })
  281. gparted_launcher = wibox.layout.constraint(gparted_launcher, "exact", 50, nil)
  282. gparted_launcher = wibox.layout.margin(gparted_launcher, 10, 10, 10, 10 )
  283.  
  284. synaptic_launcher = awful.widget.launcher({ image = home .. '/.local/share/icons/synaptic.png', command = 'sudo synaptic' })
  285. synaptic_launcher = wibox.layout.constraint(synaptic_launcher, "exact", 50, nil)
  286. synaptic_launcher = wibox.layout.margin(synaptic_launcher, 10, 10, 10, 10 )
  287.  
  288. updater_launcher = awful.widget.launcher({ image = home .. '/.local/share/icons/system-software-update.png', command = 'sudo update-manager' })
  289. updater_launcher = wibox.layout.constraint(updater_launcher, "exact", 50, nil)
  290. updater_launcher = wibox.layout.margin(updater_launcher, 10, 10, 10, 10 )
  291.  
  292. wicd_launcher = awful.widget.launcher({ image = '/usr/share/icons/hicolor/64x64/apps/wicd-gtk.png', command = 'wicd-gtk' })
  293. wicd_launcher = wibox.layout.constraint(wicd_launcher, "exact", 50, nil)
  294. wicd_launcher = wibox.layout.margin(wicd_launcher, 10, 10, 10, 10 )
  295.  
  296. sysmon_launcher = awful.widget.launcher({ image = '/usr/share/icons/gnome/48x48/apps/utilities-system-monitor.png', command = 'gnome-system-monitor' })
  297. sysmon_launcher = wibox.layout.constraint(sysmon_launcher, "exact", 50, nil)
  298. sysmon_launcher = wibox.layout.margin(sysmon_launcher, 10, 10, 10, 10 )
  299.  
  300. kbdcfg = {}
  301. kbdcfg.cmd = "setxkbmap"
  302. kbdcfg.layout = { { "us", "US" }, { "ru", "РУ" } }
  303. kbdcfg.current = 1 -- us is our default layout
  304. kbdcfg.widget = wibox.widget.textbox()
  305. kbdcfg.widget:set_text("" .. kbdcfg.layout[kbdcfg.current][2] .. "")
  306. kbdcfg.switch = function ()
  307. kbdcfg.current = kbdcfg.current % #(kbdcfg.layout) + 1
  308. local t = kbdcfg.layout[kbdcfg.current]
  309. kbdcfg.widget:set_text("" .. t[2] .. "")
  310. if kbdcfg.current == 2 then
  311. os.execute( kbdcfg.cmd .. " " .. "ru" .. ";sleep 0.25;" .. kbdcfg.cmd .. " " .. "ru,us" )
  312. else
  313. os.execute( kbdcfg.cmd .. " " .. "us" )
  314. end
  315. end
  316. kbdcfg.widget:set_align("left")
  317. kbdcfg.widget:buttons (awful.util.table.join (awful.button ({ }, 1, function ()
  318. kbdcfg.switch()
  319. end
  320. )
  321. )
  322. )
  323.  
  324. myuptimewidget = wibox.widget.textbox()
  325. myuptimewidget:set_align("left")
  326. vicious.register(myuptimewidget, vicious.widgets.uptime, "$1d; $2h; $3m", 1)
  327.  
  328. downwidget = wibox.widget.textbox()
  329. downwidget:set_align("left")
  330. vicious.register(downwidget, vicious.widgets.net,
  331. function (downwidget, args)
  332. downvalue = args ["{wlp2s0f0 down_b}"]
  333. return downvalue
  334. end, 1 )
  335. downwidget = wibox.layout.constraint(downwidget, "exact", 85, nil)
  336.  
  337. downprogressbar = awful.widget.progressbar()
  338. vicious.register(downprogressbar, vicious.widgets.net,
  339. function (downprogressbar, args)
  340. return math.floor ( math.log ( tonumber ( downvalue ) + 1 ) * 6 )
  341. end, 1 )
  342. downprogressbar:set_width(230)
  343. downprogressbar:set_height(2)
  344. downprogressbar:set_vertical(false)
  345. downprogressbar:set_color('#00ffff88')
  346. downprogressbar:set_background_color('#00000088')
  347.  
  348. upwidget = wibox.widget.textbox()
  349. upwidget:set_align("left")
  350. vicious.register(upwidget, vicious.widgets.net,
  351. function (upwidget, args)
  352. upvalue = args ["{wlp2s0f0 up_b}"]
  353. return upvalue
  354. end, 1 )
  355. upwidget = wibox.layout.constraint(upwidget, "exact", 85, nil)
  356.  
  357. upprogressbar = awful.widget.progressbar()
  358. vicious.register(upprogressbar, vicious.widgets.net,
  359. function (upprogressbar, args)
  360. return math.floor ( math.log ( tonumber ( upvalue ) + 1 ) * 6 )
  361. end, 1 )
  362. upprogressbar:set_width(230)
  363. upprogressbar:set_height(2)
  364. upprogressbar:set_vertical(false)
  365. upprogressbar:set_color('#00ffff88')
  366. upprogressbar:set_background_color('#00000088')
  367.  
  368. partwidget = wibox.widget.textbox()
  369. partwidget:set_align("left")
  370. vicious.register(partwidget, vicious.widgets.fs,
  371. function (partwidget, args)
  372. root_used = args ["{/ used_gb}"]
  373. root_size = args ["{/ size_gb}"]
  374. home_used = args ["{/home used_gb}"]
  375. home_size = args ["{/home size_gb}"]
  376. return root_used .. '/' .. root_size .. 'G'
  377. end, 1 )
  378. partwidget = wibox.layout.constraint(partwidget, "exact", 85, nil)
  379.  
  380. rootprogressbar = awful.widget.progressbar()
  381. vicious.register(rootprogressbar, vicious.widgets.fs,
  382. function (rootprogressbar, args)
  383. return math.floor ( 100 * tonumber ( root_used ) / ( tonumber ( root_size ) ) )
  384. end, 1 )
  385. rootprogressbar:set_width(230)
  386. rootprogressbar:set_height(2)
  387. rootprogressbar:set_vertical(false)
  388. rootprogressbar:set_color('#00ffff88')
  389. rootprogressbar:set_background_color('#00000088')
  390.  
  391. homewidget = wibox.widget.textbox()
  392. homewidget:set_align("left")
  393. vicious.register(homewidget, vicious.widgets.fs,
  394. function (homewidget, args)
  395. return home_used .. '/' .. home_size .. 'G'
  396. end, 1 )
  397. homewidget = wibox.layout.constraint(homewidget, "exact", 105, nil)
  398.  
  399. homeprogressbar = awful.widget.progressbar()
  400. vicious.register(homeprogressbar, vicious.widgets.fs,
  401. function (homeprogressbar, args)
  402. return math.floor ( 100 * tonumber ( home_used ) / ( tonumber ( home_size ) ) )
  403. end, 1 )
  404. homeprogressbar:set_width(230)
  405. homeprogressbar:set_height(2)
  406. homeprogressbar:set_vertical(false)
  407. homeprogressbar:set_color('#00FFFF88')
  408. homeprogressbar:set_background_color('#00000088')
  409.  
  410. pswidget = wibox.widget.textbox()
  411. pswidget:set_align("right")
  412. pswidget:set_text(io.popen("ps -Ao comm,pcpu,pmem --sort=-pcpu | head -n 9 | tail -n 8"):read("*a"))
  413. pswidget:buttons( awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell('gnome-system-monitor') end)))
  414.  
  415. cpuwidget = wibox.widget.textbox()
  416. cpuwidget:set_align("left")
  417. vicious.register(cpuwidget, vicious.widgets.cpu,
  418. function (cpuwidget, args)
  419. cpupercent = args [1]
  420. return cpupercent .. "% "
  421. end, 1)
  422.  
  423. cpuprogressbar = awful.widget.progressbar()
  424. vicious.register(cpuprogressbar, vicious.widgets.cpu,
  425. function (cpuprogressbar, args)
  426. return tonumber ( cpupercent )
  427. end, 1 )
  428. cpuprogressbar:set_width(230)
  429. cpuprogressbar:set_height(2)
  430. cpuprogressbar:set_vertical(false)
  431. cpuprogressbar:set_color('#00ffff88')
  432. cpuprogressbar:set_background_color('#00000088')
  433.  
  434. cpufreqwidget = wibox.widget.textbox()
  435. cpufreqwidget:set_align("left")
  436. vicious.register(cpufreqwidget, vicious.widgets.cpufreq, "$5 ", 1, 'cpu0')
  437.  
  438. memwidget = wibox.widget.textbox()
  439. memwidget:set_align("left")
  440. vicious.register(memwidget, vicious.widgets.mem,
  441. function (memwidget, args)
  442. mempercent = args [1]
  443. return mempercent .. "% "
  444. end, 1)
  445. memprogressbar = awful.widget.progressbar()
  446. vicious.register(memprogressbar, vicious.widgets.mem,
  447. function (memprogressbar, args)
  448. return tonumber ( mempercent )
  449. end, 1 )
  450. memprogressbar:set_width(230)
  451. memprogressbar:set_height(2)
  452. memprogressbar:set_vertical(false)
  453. memprogressbar:set_color('#00ffff88')
  454. memprogressbar:set_background_color('#00000088')
  455.  
  456. batwidget = wibox.widget.textbox()
  457. vicious.register(batwidget, vicious.widgets.bat, "$2% ", 1, 'BAT0')
  458.  
  459. thermalwidget = wibox.widget.textbox()
  460. thermalwidget:set_align("left")
  461. vicious.register(thermalwidget, vicious.widgets.thermal, "$1°С ", 1, "thermal_zone7")
  462.  
  463. slashwidget = wibox.widget.textbox()
  464. slashwidget:set_align("left")
  465. slashwidget:set_markup('<span color="#00FFFF">/</span> ')
  466.  
  467. spacewidget = wibox.widget.textbox()
  468. spacewidget:set_align("left")
  469. spacewidget:set_markup(' ')
  470.  
  471. fanwidget = wibox.widget.textbox()
  472. fanwidget:set_align("left")
  473. fanwidget:buttons (
  474. awful.util.table.join (
  475. awful.button({ }, 1, function ()
  476. awful.util.spawn_with_shell('fan.sh left')
  477. end),
  478. awful.button({ }, 2, function ()
  479. awful.util.spawn_with_shell('fan.sh auto')
  480. end),
  481. awful.button({ }, 3, function ()
  482. awful.util.spawn_with_shell('fan.sh right')
  483. end)
  484. )
  485. )
  486.  
  487. sdbwidget = wibox.widget.textbox()
  488. sdbwidget:set_align("left")
  489.  
  490. GDwidget = wibox.widget.textbox()
  491. GDwidget:set_align("left")
  492.  
  493. andwidget = wibox.widget.textbox()
  494. andwidget:set_align("left")
  495.  
  496. smbwidget = wibox.widget.textbox()
  497. smbwidget:set_align("left")
  498.  
  499. ftpwidget = wibox.widget.textbox()
  500. ftpwidget:set_align("left")
  501.  
  502. wowidget = wibox.widget.textbox()
  503. wowidget:set_align("left")
  504. wowidget:buttons( awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell('wallpaper.sh o') end)))
  505.  
  506. wfwidget = wibox.widget.textbox()
  507. wfwidget:set_align("left")
  508. wfwidget:set_markup("wf ")
  509. wfwidget:buttons( awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell('wallpaper.sh f') end)))
  510.  
  511. wbwidget = wibox.widget.textbox()
  512. wbwidget:set_align("left")
  513. wbwidget:set_markup("wb ")
  514. wbwidget:buttons( awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell('wallpaper.sh b') end)))
  515.  
  516. wvwidget = wibox.widget.textbox()
  517. wvwidget:set_align("left")
  518. wvwidget:set_markup("wv ")
  519. wvwidget:buttons( awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell('wallpaper.sh e') end)))
  520.  
  521. wpwidget = wibox.widget.textbox()
  522. wpwidget:set_align("left")
  523. wpwidget:set_markup("wp ")
  524. wpwidget:buttons( awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell('wallpaper.sh p') end)))
  525.  
  526. artfilewidget = wibox.widget.textbox()
  527. artfilewidget:set_align("left")
  528. artfilewidget:set_markup('artfile ')
  529. artfilewidget:buttons (
  530. awful.util.table.join (
  531. awful.button({ }, 1, function ()
  532. awful.util.spawn_with_shell('wallpaper.sh artfile')
  533. end)
  534. )
  535. )
  536.  
  537. bindimagewidget = wibox.widget.textbox()
  538. bindimagewidget:set_align("left")
  539. bindimagewidget:set_markup('bindimage ')
  540. bindimagewidget:buttons (
  541. awful.util.table.join (
  542. awful.button({ }, 1, function ()
  543. awful.util.spawn_with_shell('wallpaper.sh bindimage')
  544. end)
  545. )
  546. )
  547.  
  548. deviantartwidget = wibox.widget.textbox()
  549. deviantartwidget:set_align("left")
  550. deviantartwidget:set_markup('deviantart ')
  551. deviantartwidget:buttons (
  552. awful.util.table.join (
  553. awful.button({ }, 1, function ()
  554. awful.util.spawn_with_shell('wallpaper.sh deviantart')
  555. end)
  556. )
  557. )
  558.  
  559. collectionwidget = wibox.widget.textbox()
  560. collectionwidget:set_align("left")
  561. collectionwidget:set_markup('collection ')
  562. collectionwidget:buttons (
  563. awful.util.table.join (
  564. awful.button({ }, 1, function ()
  565. awful.util.spawn_with_shell('wallpaper.sh collection')
  566. end)
  567. )
  568. )
  569.  
  570. flickrwidget = wibox.widget.textbox()
  571. flickrwidget:set_align("left")
  572. flickrwidget:set_markup('flickr ')
  573. flickrwidget:buttons (
  574. awful.util.table.join (
  575. awful.button({ }, 1, function ()
  576. awful.util.spawn_with_shell('wallpaper.sh flickr')
  577. end)
  578. )
  579. )
  580.  
  581. favoritieswidget = wibox.widget.textbox()
  582. favoritieswidget:set_align("left")
  583. favoritieswidget:set_markup('favorities ')
  584. favoritieswidget:buttons (
  585. awful.util.table.join (
  586. awful.button({ }, 1, function ()
  587. awful.util.spawn_with_shell('wallpaper.sh favorities')
  588. end)
  589. )
  590. )
  591.  
  592. paperchanwidget = wibox.widget.textbox()
  593. paperchanwidget:set_align("left")
  594. paperchanwidget:set_markup('paperchan ')
  595. paperchanwidget:buttons (
  596. awful.util.table.join (
  597. awful.button({ }, 1, function ()
  598. awful.util.spawn_with_shell('wallpaper.sh paperchan')
  599. end)
  600. )
  601. )
  602.  
  603. oboihdwidget = wibox.widget.textbox()
  604. oboihdwidget:set_align("left")
  605. oboihdwidget:set_markup('oboihd ')
  606. oboihdwidget:buttons (
  607. awful.util.table.join (
  608. awful.button({ }, 1, function ()
  609. awful.util.spawn_with_shell('wallpaper.sh oboihd')
  610. end)
  611. )
  612. )
  613.  
  614. usiterwidget = wibox.widget.textbox()
  615. usiterwidget:set_align("left")
  616. usiterwidget:set_markup('usiter ')
  617. usiterwidget:buttons (
  618. awful.util.table.join (
  619. awful.button({ }, 1, function ()
  620. awful.util.spawn_with_shell('wallpaper.sh usiter')
  621. end)
  622. )
  623. )
  624.  
  625. wallheavenwidget = wibox.widget.textbox()
  626. wallheavenwidget:set_align("left")
  627. wallheavenwidget:set_markup('wallheaven ')
  628. wallheavenwidget:buttons (
  629. awful.util.table.join (
  630. awful.button({ }, 1, function ()
  631. awful.util.spawn_with_shell('wallpaper.sh wallheaven')
  632. end)
  633. )
  634. )
  635.  
  636. picscreenwidget = wibox.widget.textbox()
  637. picscreenwidget:set_align("left")
  638. picscreenwidget:set_markup('picscreen ')
  639. picscreenwidget:buttons (
  640. awful.util.table.join (
  641. awful.button({ }, 1, function ()
  642. awful.util.spawn_with_shell('wallpaper.sh picscreen')
  643. end)
  644. )
  645. )
  646.  
  647. rowidget = wibox.widget.textbox()
  648. rowidget:set_align("left")
  649. rowidget:buttons( awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell('rss.sh o') end)))
  650.  
  651. rawidget = wibox.widget.textbox()
  652. rawidget:set_align("left")
  653. rawidget:buttons( awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell('rss.sh ov') end)))
  654.  
  655. rfwidget = wibox.widget.textbox()
  656. rfwidget:set_align("left")
  657. rfwidget:set_markup("rf ")
  658. rfwidget:buttons( awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell('gvim ~/tmp/rss') end)))
  659.  
  660. calbox = wibox.widget.textbox()
  661. calbox:set_align("left")
  662. calbox:set_markup(io.popen("cal.sh"):read("*a"))
  663.  
  664. weatherbox = wibox.widget.textbox()
  665. weatherbox:set_align("left")
  666. weatherbox:set_markup(io.popen("weather.sh"):read("*a"))
  667. weatherbox:buttons (
  668. awful.util.table.join (
  669. awful.button({ }, 1, function ()
  670. awful.util.spawn_with_shell('weather.sh e')
  671. end),
  672. awful.button({ }, 3, function ()
  673. weatherbox:set_markup(io.popen("weather.sh"):read("*a"))
  674. end)
  675.  
  676. )
  677. )
  678.  
  679. notebox = wibox.widget.textbox()
  680. notebox._layout:set_justify(true)
  681. notebox:set_markup(io.popen("cat /tmp/mem/piyavking/sticker"):read("*a"))
  682. notebox:buttons (
  683. awful.util.table.join (
  684. awful.button({ }, 1, function ()
  685. if io.open(home .. '/tmp/sticker_flag',"r") == nil then
  686. awful.util.spawn_with_shell('x-www-browser http://www.inoreader.com/stream/user/1005968053/tag/text')
  687. else
  688. awful.util.spawn_with_shell('edit_note.sh')
  689. end
  690. end),
  691. awful.button({ }, 3, function ()
  692. if io.open(home .. '/tmp/sticker_flag',"r") == nil then
  693. awful.util.spawn_with_shell('touch ' .. home .. '/tmp/sticker_flag')
  694. else
  695. awful.util.spawn_with_shell('rm ' .. home .. '/tmp/sticker_flag')
  696. end
  697. awful.util.spawn_with_shell('rss.sh sticker')
  698. end)
  699. )
  700. )
  701. emptywidget = wibox.widget.textbox()
  702. emptywidget:set_markup(' ')
  703. -- mydeskwibox_1
  704. local mydeskwibox_1_top = wibox.layout.fixed.vertical()
  705. local mydeskwibox_1_top_1 = wibox.layout.fixed.horizontal()
  706. mydeskwibox_1_top_1:add(urxvt_launcher)
  707. mydeskwibox_1_top_1:add(gparted_launcher)
  708. mydeskwibox_1_top_1:add(wicd_launcher)
  709. mydeskwibox_1_top:add(mydeskwibox_1_top_1)
  710. local mydeskwibox_1_top_2 = wibox.layout.fixed.horizontal()
  711. mydeskwibox_1_top_2:add(nc_launcher)
  712. mydeskwibox_1_top_2:add(tc_launcher)
  713. mydeskwibox_1_top:add(mydeskwibox_1_top_2)
  714. local mydeskwibox_1_top_3 = wibox.layout.fixed.horizontal()
  715. mydeskwibox_1_top_3:add(synaptic_launcher)
  716. mydeskwibox_1_top_3:add(updater_launcher)
  717. mydeskwibox_1_top:add(mydeskwibox_1_top_3)
  718. local mydeskwibox_1_top_4 = wibox.layout.fixed.horizontal()
  719. mydeskwibox_1_top_4:add(sysmon_launcher)
  720. mydeskwibox_1_top:add(mydeskwibox_1_top_4)
  721. local mydeskwibox_1_layout = wibox.layout.align.vertical()
  722. mydeskwibox_1_layout:set_top(mydeskwibox_1_top)
  723. -- mydeskwibox_2
  724. local mydeskwibox_2_top = wibox.layout.fixed.vertical()
  725. local mydeskwibox_2_top_1 = wibox.layout.fixed.horizontal()
  726. mydeskwibox_2_top_1:add(seamonkey_launcher)
  727. mydeskwibox_2_top_1:add(chromium_launcher)
  728. mydeskwibox_2_top:add(mydeskwibox_2_top_1)
  729. local mydeskwibox_2_top_2 = wibox.layout.fixed.horizontal()
  730. mydeskwibox_2_top_2:add(composer_launcher)
  731. mydeskwibox_2_top_2:add(gvim_launcher)
  732. mydeskwibox_2_top_2:add(lowriter_launcher)
  733. mydeskwibox_2_top:add(mydeskwibox_2_top_2)
  734. local mydeskwibox_2_layout = wibox.layout.align.vertical()
  735. mydeskwibox_2_layout:set_top(mydeskwibox_2_top)
  736. -- mydeskwibox_3
  737. local mydeskwibox_3_layout = wibox.layout.fixed.horizontal()
  738. mydeskwibox_3_layout:add(seamonkey_mail_launcher)
  739. mydeskwibox_3_layout:add(pidgin_launcher)
  740. mydeskwibox_3_layout:add(skype_launcher)
  741. -- mydeskwibox_4
  742. local mydeskwibox_4_top = wibox.layout.fixed.vertical()
  743. local mydeskwibox_4_top_1 = wibox.layout.fixed.horizontal()
  744. mydeskwibox_4_top_1:add(blood_launcher)
  745. mydeskwibox_4_top_1:add(cryptic_launcher)
  746. mydeskwibox_4_top:add(mydeskwibox_4_top_1)
  747. local mydeskwibox_4_top_2 = wibox.layout.fixed.horizontal()
  748. mydeskwibox_4_top_2:add(RR_launcher)
  749. mydeskwibox_4_top_2:add(RA_launcher)
  750. mydeskwibox_4_top_2:add(Route66_launcher)
  751. mydeskwibox_4_top:add(mydeskwibox_4_top_2)
  752. local mydeskwibox_4_top_3 = wibox.layout.fixed.horizontal()
  753. mydeskwibox_4_top_3:add(hexen1_launcher)
  754. mydeskwibox_4_top_3:add(hexen2_launcher)
  755. mydeskwibox_4_top:add(mydeskwibox_4_top_3)
  756. local mydeskwibox_4_top_4 = wibox.layout.fixed.horizontal()
  757. mydeskwibox_4_top_4:add(pacman_launcher)
  758. mydeskwibox_4_top_4:add(pacmania_launcher)
  759. mydeskwibox_4_top_4:add(abadox_launcher)
  760. mydeskwibox_4_top:add(mydeskwibox_4_top_4)
  761. local mydeskwibox_4_layout = wibox.layout.align.vertical()
  762. mydeskwibox_4_layout:set_top(mydeskwibox_4_top)
  763. -- mydeskwibox_5
  764. local mydeskwibox_5_top_1 = wibox.layout.fixed.horizontal()
  765. mydeskwibox_5_top_1:add(GR_launcher)
  766. mydeskwibox_5_top_1:add(FL_launcher)
  767. local mydeskwibox_5_top_2 = wibox.layout.fixed.horizontal()
  768. mydeskwibox_5_top_2:add(qjackctl_launcher)
  769. mydeskwibox_5_top_2:add(jmixer_launcher)
  770. local mydeskwibox_5_top_3 = wibox.layout.fixed.horizontal()
  771. mydeskwibox_5_top_3:add(audacity_launcher)
  772. --mydeskwibox_5_top_3:add(avidemux_launcher)
  773. mydeskwibox_5_top_3:add(handbrake_launcher)
  774. mydeskwibox_5_top_3:add(gimp_launcher)
  775. local mydeskwibox_5_top_4 = wibox.layout.fixed.horizontal()
  776. mydeskwibox_5_top_4:add(pavucontrol_launcher)
  777. local mydeskwibox_5_top = wibox.layout.fixed.vertical()
  778. mydeskwibox_5_top:add(mydeskwibox_5_top_1)
  779. mydeskwibox_5_top:add(mydeskwibox_5_top_2)
  780. mydeskwibox_5_top:add(mydeskwibox_5_top_3)
  781. mydeskwibox_5_top:add(mydeskwibox_5_top_4)
  782. local mydeskwibox_5_layout = wibox.layout.align.vertical()
  783. mydeskwibox_5_layout:set_top(mydeskwibox_5_top)
  784. -- mydeskwibox_6
  785. local mydeskwibox_6_layout = wibox.layout.fixed.horizontal()
  786. mydeskwibox_6_layout:add(mplaylist_launcher)
  787. mydeskwibox_6_layout:add(mplaylist_s_launcher)
  788. mydeskwibox_6_layout:add(smplayer_launcher)
  789. mydeskwibox_6_layout:add(smtube_launcher)
  790. mydeskwibox_6_layout:add(projectm_launcher)
  791. -- mydeskwibox1
  792. local mydeskwibox1_layout_top_1_1 = wibox.layout.fixed.vertical()
  793. mydeskwibox1_layout_top_1_1:add(myuptimewidget)
  794. mydeskwibox1_layout_top_1_1:add(emptywidget)
  795. local rpanel = wibox.layout.fixed.horizontal()
  796. rpanel:add(rowidget)
  797. rpanel:add(rawidget)
  798. rpanel:add(rfwidget)
  799. rpanel:add(wvwidget)
  800. mydeskwibox1_layout_top_1_1:add(rpanel)
  801. local wpanel = wibox.layout.fixed.horizontal()
  802. wpanel:add(wowidget)
  803. wpanel:add(wpwidget)
  804. wpanel:add(wfwidget)
  805. wpanel:add(wbwidget)
  806. mydeskwibox1_layout_top_1_1:add(wpanel)
  807. mydeskwibox1_layout_top_1_1:add(deviantartwidget)
  808. mydeskwibox1_layout_top_1_1:add(flickrwidget)
  809. mydeskwibox1_layout_top_1_1:add(paperchanwidget)
  810. mydeskwibox1_layout_top_1_1:add(usiterwidget)
  811. mydeskwibox1_layout_top_1_1:add(picscreenwidget)
  812. local mydeskwibox1_layout_top_1_2 = wibox.layout.fixed.vertical()
  813. mytextclock = awful.widget.textclock("%H:%M:%S", 1)
  814. mydeskwibox1_layout_top_1_2:add(emptywidget)
  815. mydeskwibox1_layout_top_1_2:add(emptywidget)
  816.  
  817. mydeskwibox1_layout_top_1_2:add(artfilewidget)
  818. mydeskwibox1_layout_top_1_2:add(bindimagewidget)
  819. mydeskwibox1_layout_top_1_2:add(collectionwidget)
  820. mydeskwibox1_layout_top_1_2:add(favoritieswidget)
  821. mydeskwibox1_layout_top_1_2:add(oboihdwidget)
  822. mydeskwibox1_layout_top_1_2:add(wallheavenwidget)
  823. local mydeskwibox1_layout_top_1_3 = wibox.layout.fixed.vertical()
  824. mydeskwibox1_layout_top_1_3:add(calbox)
  825. local mydeskwibox1_layout_top_1 = wibox.layout.align.horizontal()
  826. mydeskwibox1_layout_top_1:set_left(mydeskwibox1_layout_top_1_1)
  827. mydeskwibox1_layout_top_1:set_middle(mydeskwibox1_layout_top_1_2)
  828. mydeskwibox1_layout_top_1:set_right(mydeskwibox1_layout_top_1_3)
  829. local rootbox_1 = wibox.layout.fixed.horizontal()
  830. rootbox_1:add(partwidget)
  831. local rootbox_3 = wibox.layout.fixed.horizontal()
  832. rootbox_3:add(wibox.layout.margin(rootprogressbar, 0, 0, 3, 3 ))
  833. local rootbox = wibox.layout.align.horizontal()
  834. rootbox:set_left(rootbox_1)
  835. rootbox:set_right(rootbox_3)
  836. local homebox_1 = wibox.layout.fixed.horizontal()
  837. homebox_1:add(homewidget)
  838. local homebox_3 = wibox.layout.fixed.horizontal()
  839. homebox_3:add(wibox.layout.margin(homeprogressbar, 0, 0, 3, 3 ))
  840. local homebox = wibox.layout.align.horizontal()
  841. homebox:set_left(homebox_1)
  842. homebox:set_right(homebox_3)
  843.  
  844. local mydeskwibox1_layout_top_3_1 = wibox.layout.fixed.vertical()
  845. mydeskwibox1_layout_top_3_1:add(sdbwidget)
  846. mydeskwibox1_layout_top_3_1:add(GDwidget)
  847. mydeskwibox1_layout_top_3_1:add(andwidget)
  848. mydeskwibox1_layout_top_3_1:add(smbwidget)
  849. mydeskwibox1_layout_top_3_1:add(ftpwidget)
  850. local mydeskwibox1_layout_top_3_3 = wibox.layout.fixed.horizontal()
  851. mydeskwibox1_layout_top_3_3:add(pswidget)
  852. local mydeskwibox1_layout_top_3 = wibox.layout.align.horizontal()
  853. mydeskwibox1_layout_top_3:set_left(mydeskwibox1_layout_top_3_1)
  854. mydeskwibox1_layout_top_3:set_right(mydeskwibox1_layout_top_3_3)
  855.  
  856. local cpubox_1 = wibox.layout.fixed.horizontal()
  857. cpubox_1:add(cpuwidget)
  858. cpubox_1:add(cpufreqwidget)
  859. local cpubox_3 = wibox.layout.fixed.horizontal()
  860. cpubox_3:add(wibox.layout.margin(cpuprogressbar, 0, 0, 3, 3 ))
  861. local cpubox = wibox.layout.align.horizontal()
  862. cpubox:set_left(cpubox_1)
  863. cpubox:set_right(cpubox_3)
  864.  
  865. local membox_1 = wibox.layout.fixed.horizontal()
  866. membox_1:add(memwidget)
  867. local membox_3 = wibox.layout.fixed.horizontal()
  868. membox_3:add(wibox.layout.margin(memprogressbar, 0, 0, 3, 3 ))
  869. local membox = wibox.layout.align.horizontal()
  870. membox:set_left(membox_1)
  871. membox:set_right(membox_3)
  872.  
  873. local mydeskwibox1_layout_top = wibox.layout.fixed.vertical()
  874. local mydeskwibox1_layout_top_2 = wibox.layout.fixed.vertical()
  875. mydeskwibox1_layout_top_2:add(weatherbox)
  876. mydeskwibox1_layout_top:add(mydeskwibox1_layout_top_1)
  877. mydeskwibox1_layout_top:add(mydeskwibox1_layout_top_2)
  878. mydeskwibox1_layout_top:add(mydeskwibox1_layout_top_3)
  879.  
  880. local downbox_1 = wibox.layout.fixed.horizontal()
  881. downbox_1:add(downwidget)
  882. local downbox_3 = wibox.layout.fixed.horizontal()
  883. downbox_3:add(wibox.layout.margin(downprogressbar, 0, 0, 3, 3 ))
  884. local downbox = wibox.layout.align.horizontal()
  885. downbox:set_left(downbox_1)
  886. downbox:set_right(downbox_3)
  887. local upbox_1 = wibox.layout.fixed.horizontal()
  888. upbox_1:add(upwidget)
  889. local upbox_3 = wibox.layout.fixed.horizontal()
  890. upbox_3:add(wibox.layout.margin(upprogressbar, 0, 0, 3, 3 ))
  891. local upbox = wibox.layout.align.horizontal()
  892. upbox:set_left(upbox_1)
  893. upbox:set_right(upbox_3)
  894. local mydeskwibox1_layout_bottom = wibox.layout.fixed.vertical()
  895. mydeskwibox1_layout_bottom:add(rootbox)
  896. mydeskwibox1_layout_bottom:add(homebox)
  897. mydeskwibox1_layout_bottom:add(cpubox)
  898. mydeskwibox1_layout_bottom:add(membox)
  899. mydeskwibox1_layout_bottom:add(downbox)
  900. mydeskwibox1_layout_bottom:add(upbox)
  901.  
  902. local mydeskwibox1_layout_middle = wibox.layout.fixed.vertical()
  903.  
  904. local mydeskwibox1_layout = wibox.layout.align.vertical()
  905. mydeskwibox1_layout:set_top(mydeskwibox1_layout_top)
  906. mydeskwibox1_layout:set_middle(mydeskwibox1_layout_middle)
  907. mydeskwibox1_layout:set_bottom(mydeskwibox1_layout_bottom)
  908. -- mydeskwibox2
  909. local mydeskwibox2_layout = wibox.layout.fixed.vertical()
  910. mydeskwibox2_layout:add(notebox)
  911. -- timer
  912. mytimer = timer({ timeout = '1' })
  913. mytimer:connect_signal("timeout", function()
  914. sdb_markup = 'sdb '
  915. sdb_cmd = 'sudo mount /dev/sdb1 /flash'
  916. GD_markup = 'gdr '
  917. GD_cmd = 'google-drive-ocamlfuse ' .. home .. '/google-drive'
  918. and_markup = 'adr '
  919. and_cmd = 'jmtpfs ' .. home .. '/android'
  920. smb_markup = 'smb '
  921. -- smb_cmd = 'sudo mount.cifs -o username=chowder,password="2012",rw,file_mode=0666,dir_mode=0777,uid=piyavking //CHOWDER-PC/D ' .. home .. '/sambashare'
  922. smb_cmd = 'smbnetfs ' .. home .. '/sambashare'
  923. ftp_markup = 'ftp '
  924. ftp_cmd = 'curlftpfs -o user=piyavking@gmail.com:86673709 node0.net2ftp.ru:21 ' .. home .. '/myftp'
  925. mount = io.popen("mount")
  926. for line in mount:lines() do
  927. if string.find(line, 'sdb1') ~= nil then
  928. sdb_markup = '<span color="#00FFFF">sdb</span> '
  929. sdb_cmd = 'sudo umount -l /dev/sdb1'
  930. end
  931. if string.find(line, 'google') ~= nil then
  932. GD_markup = '<span color="#00FFFF">gdr</span> '
  933. GD_cmd = 'sudo umount -l ' .. home .. '/google-drive'
  934. end
  935. if string.find(line, 'android') ~= nil then
  936. and_markup = '<span color="#00FFFF">adr</span> '
  937. and_cmd = 'sudo umount -l ' .. home .. '/android'
  938. end
  939. if string.find(line, 'sambashare') ~= nil then
  940. smb_markup = '<span color="#00FFFF">smb</span> '
  941. smb_cmd = 'sudo umount -l ' .. home .. '/sambashare'
  942. end
  943. if string.find(line, 'myftp') ~= nil then
  944. ftp_markup = '<span color="#00FFFF">ftp</span> '
  945. ftp_cmd = 'sudo umount -l ' .. home .. '/myftp'
  946. end
  947. end
  948. if io.open(home .. '/Pictures/wallpapers/wallpaper_flag',"r") == nil then
  949. wo_markup = 'wo '
  950. else
  951. wo_markup = '<span color="#00FFFF">wo</span> '
  952. end
  953. if io.open(home .. '/tmp/rss_flag',"r") == nil then
  954. ro_markup = 'ro '
  955. else
  956. ro_markup = '<span color="#00FFFF">ro</span> '
  957. end
  958. if io.open(home .. '/tmp/voice_flag',"r") == nil then
  959. ra_markup = 'ra '
  960. else
  961. ra_markup = '<span color="#00FFFF">ra</span> '
  962. end
  963. sdbwidget:set_markup(sdb_markup)
  964. sdbwidget:buttons( awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell(sdb_cmd) end)))
  965. GDwidget:set_markup(GD_markup)
  966. GDwidget:buttons( awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell(GD_cmd) end)))
  967. andwidget:set_markup(and_markup)
  968. andwidget:buttons( awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell(and_cmd) end)))
  969. smbwidget:set_markup(smb_markup)
  970. smbwidget:buttons( awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell(smb_cmd) end)))
  971. ftpwidget:set_markup(ftp_markup)
  972. ftpwidget:buttons( awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell(ftp_cmd) end)))
  973. wowidget:set_markup(wo_markup)
  974. rowidget:set_markup(ro_markup)
  975. rawidget:set_markup(ra_markup)
  976. fanwidget:set_markup(io.popen("fan.sh"):read("*a"))
  977. if io.open(home .. '/tmp/wallpaper.lock',"r") == nil then
  978. wallsource = io.popen("cat " .. home .. "/Pictures/wallpapers/wallsource | tr -d '\n'"):read("*a")
  979. if wallsource == "artfile" then
  980. artfilewidget:set_markup('<span color="#00FFFF">artfile</span> ')
  981. elseif io.popen("cat " .. home .. "/Pictures/wallpapers/walllist.conf | grep artfile | awk -F' ' '{print $2}'"):read(1) == "1" then
  982. artfilewidget:set_markup('artfile ')
  983. else
  984. artfilewidget:set_markup('<span color="#AAAAAA">artfile</span> ')
  985. end
  986. if wallsource == "bindimage" then
  987. bindimagewidget:set_markup('<span color="#00FFFF">bindimage</span> ')
  988. elseif io.popen("cat " .. home .. "/Pictures/wallpapers/walllist.conf | grep bindimage | awk -F' ' '{print $2}'"):read(1) == "1" then
  989. bindimagewidget:set_markup('bindimage ')
  990. else
  991. bindimagewidget:set_markup('<span color="#AAAAAA">bindimage</span> ')
  992. end
  993. if wallsource == "deviantart" then
  994. deviantartwidget:set_markup('<span color="#00FFFF">deviantart</span> ')
  995. elseif io.popen("cat " .. home .. "/Pictures/wallpapers/walllist.conf | grep deviantart | awk -F' ' '{print $2}'"):read(1) == "1" then
  996. deviantartwidget:set_markup('deviantart ')
  997. else
  998. deviantartwidget:set_markup('<span color="#AAAAAA">deviantart</span> ')
  999. end
  1000. if wallsource == "collection" then
  1001. collectionwidget:set_markup('<span color="#00FFFF">collection</span> ')
  1002. elseif io.popen("cat " .. home .. "/Pictures/wallpapers/walllist.conf | grep collection | awk -F' ' '{print $2}'"):read(1) == "1" then
  1003. collectionwidget:set_markup('collection ')
  1004. else
  1005. collectionwidget:set_markup('<span color="#AAAAAA">collection</span> ')
  1006. end
  1007. if wallsource == "flickr" then
  1008. flickrwidget:set_markup('<span color="#00FFFF">flickr</span> ')
  1009. elseif io.popen("cat " .. home .. "/Pictures/wallpapers/walllist.conf | grep flickr | awk -F' ' '{print $2}'"):read(1) == "1" then
  1010. flickrwidget:set_markup('flickr ')
  1011. else
  1012. flickrwidget:set_markup('<span color="#AAAAAA">flickr</span> ')
  1013. end
  1014. if wallsource == "favorities" then
  1015. favoritieswidget:set_markup('<span color="#00FFFF">favorities</span> ')
  1016. elseif io.popen("cat " .. home .. "/Pictures/wallpapers/walllist.conf | grep favorities | awk -F' ' '{print $2}'"):read(1) == "1" then
  1017. favoritieswidget:set_markup('favorities ')
  1018. else
  1019. favoritieswidget:set_markup('<span color="#AAAAAA">favorities</span> ')
  1020. end
  1021. if wallsource == "paperchan" then
  1022. paperchanwidget:set_markup('<span color="#00FFFF">paperchan</span> ')
  1023. elseif io.popen("cat " .. home .. "/Pictures/wallpapers/walllist.conf | grep paperchan | awk -F' ' '{print $2}'"):read(1) == "1" then
  1024. paperchanwidget:set_markup('paperchan ')
  1025. else
  1026. paperchanwidget:set_markup('<span color="#AAAAAA">paperchan</span> ')
  1027. end
  1028. if wallsource == "oboihd" then
  1029. oboihdwidget:set_markup('<span color="#00FFFF">oboihd</span> ')
  1030. elseif io.popen("cat " .. home .. "/Pictures/wallpapers/walllist.conf | grep oboihd | awk -F' ' '{print $2}'"):read(1) == "1" then
  1031. oboihdwidget:set_markup('oboihd ')
  1032. else
  1033. oboihdwidget:set_markup('<span color="#AAAAAA">oboihd</span> ')
  1034. end
  1035. if wallsource == "usiter" then
  1036. usiterwidget:set_markup('<span color="#00FFFF">usiter</span> ')
  1037. elseif io.popen("cat " .. home .. "/Pictures/wallpapers/walllist.conf | grep usiter | awk -F' ' '{print $2}'"):read(1) == "1" then
  1038. usiterwidget:set_markup('usiter ')
  1039. else
  1040. usiterwidget:set_markup('<span color="#AAAAAA">usiter</span> ')
  1041. end
  1042. if wallsource == "wallheaven" then
  1043. wallheavenwidget:set_markup('<span color="#00FFFF">wallheaven</span> ')
  1044. elseif io.popen("cat " .. home .. "/Pictures/wallpapers/walllist.conf | grep wallheaven | awk -F' ' '{print $2}'"):read(1) == "1" then
  1045. wallheavenwidget:set_markup('wallheaven ')
  1046. else
  1047. wallheavenwidget:set_markup('<span color="#AAAAAA">wallheaven</span> ')
  1048. end
  1049. if wallsource == "picscreen" then
  1050. picscreenwidget:set_markup('<span color="#00FFFF">picscreen</span> ')
  1051. elseif io.popen("cat " .. home .. "/Pictures/wallpapers/walllist.conf | grep picscreen | awk -F' ' '{print $2}'"):read(1) == "1" then
  1052. picscreenwidget:set_markup('picscreen ')
  1053. else
  1054. picscreenwidget:set_markup('<span color="#AAAAAA">picscreen</span> ')
  1055. end
  1056. else
  1057. artfilewidget:set_markup('<span color="#AAAAAA">artfile</span> ')
  1058. bindimagewidget:set_markup('<span color="#AAAAAA">bindimage</span> ')
  1059. deviantartwidget:set_markup('<span color="#AAAAAA">deviantart</span> ')
  1060. collectionwidget:set_markup('<span color="#AAAAAA">collection</span> ')
  1061. flickrwidget:set_markup('<span color="#AAAAAA">flickr</span> ')
  1062. favoritieswidget:set_markup('<span color="#AAAAAA">favorities</span> ')
  1063. paperchanwidget:set_markup('<span color="#AAAAAA">paperchan</span> ')
  1064. oboihdwidget:set_markup('<span color="#AAAAAA">oboihd</span> ')
  1065. usiterwidget:set_markup('<span color="#AAAAAA">usiter</span> ')
  1066. wallheavenwidget:set_markup('<span color="#AAAAAA">wallheaven</span> ')
  1067. picscreenwidget:set_markup('<span color="#AAAAAA">picscreen</span> ')
  1068. end
  1069. pswidget:set_text(io.popen("ps.sh"):read("*a"))
  1070. end)
  1071. mytimer:start()
  1072. mytimer1 = timer({ timeout = '5' })
  1073. mytimer1:connect_signal("timeout", function()
  1074. notebox:set_markup(io.popen("cat /tmp/mem/piyavking/sticker"):read("*a"))
  1075. -- notebox:emit_signal("widget::updated")
  1076. calbox:set_markup(io.popen("cal.sh"):read("*a"))
  1077. end)
  1078. mytimer1:start()
  1079. mytimer2 = timer({ timeout = '600' })
  1080. mytimer2:connect_signal("timeout", function()
  1081. weatherbox:set_markup(io.popen("weather.sh"):read("*a"))
  1082. end)
  1083. mytimer2:start()
  1084.  
  1085. -------------------------------------------------------------------------------
  1086.  
  1087. -- Menubar configuration
  1088. menubar.utils.terminal = terminal -- Set the terminal for applications that require it
  1089. -- }}}
  1090.  
  1091. -- {{{ Wibox
  1092. -- Create a textclock widget
  1093. -- mytextclock = awful.widget.textclock()
  1094.  
  1095. -- Create a wibox for each screen and add it
  1096. -------------------------------------------------------------------------------
  1097. mydeskwibox = {}
  1098. mydeskwibox1 = {}
  1099. mydeskwibox2 = {}
  1100. mywibox1 = {}
  1101. -------------------------------------------------------------------------------
  1102. mywibox = {}
  1103. mypromptbox = {}
  1104. mylayoutbox = {}
  1105. mytaglist = {}
  1106. mytaglist.buttons = awful.util.table.join(
  1107. awful.button({ }, 1, awful.tag.viewonly),
  1108. awful.button({ modkey }, 1, awful.client.movetotag),
  1109. awful.button({ }, 3, awful.tag.viewtoggle),
  1110. awful.button({ modkey }, 3, awful.client.toggletag),
  1111. awful.button({ }, 4, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end),
  1112. awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end)
  1113. )
  1114. mytasklist = {}
  1115. mytasklist.buttons = awful.util.table.join(
  1116. awful.button({ }, 1, function (c)
  1117. if c == client.focus then
  1118. c.minimized = true
  1119. else
  1120. -- Without this, the following
  1121. -- :isvisible() makes no sense
  1122. c.minimized = false
  1123. if not c:isvisible() then
  1124. awful.tag.viewonly(c:tags()[1])
  1125. end
  1126. -- This will also un-minimize
  1127. -- the client, if needed
  1128. client.focus = c
  1129. c:raise()
  1130. end
  1131. end),
  1132. -- awful.button({ }, 3, function ()
  1133. awful.button({ }, 3, function (c)
  1134. -- if instance then
  1135. -- instance:hide()
  1136. -- instance = nil
  1137. -- else
  1138. -- instance = awful.menu.clients({
  1139. -- theme = { width = 250 }
  1140. -- })
  1141. -- end
  1142. c:kill()
  1143. end),
  1144. awful.button({ }, 4, function ()
  1145. awful.client.focus.byidx(1)
  1146. if client.focus then client.focus:raise() end
  1147. end),
  1148. awful.button({ }, 5, function ()
  1149. awful.client.focus.byidx(-1)
  1150. if client.focus then client.focus:raise() end
  1151. end))
  1152.  
  1153. for s = 1, screen.count() do
  1154. -- Create mydeskwibox and set layout
  1155. mydeskwibox[s] = wibox ({ bg = "#00000088", width = 1000, height = 470, x = 0, y = 0 })
  1156. mydeskwibox[s].ontop = false
  1157. mydeskwibox[s].visible = true
  1158. -- Create mydeskwibox1 and set layout
  1159. mydeskwibox1[s] = wibox ({ bg = "#00000088", width = 366, height = 470, x = 1000, y = 0 })
  1160. mydeskwibox1[s].ontop = false
  1161. mydeskwibox1[s].visible = true
  1162. mydeskwibox1[s]:set_widget(wibox.layout.margin(mydeskwibox1_layout, 10, 10, 30, 10 ))
  1163. -- Create mydeskwibox2 and set layout
  1164. mydeskwibox2[s] = wibox ({ bg = "#00000088", width = 1366, height = 298, x = 0, y = 470 })
  1165. mydeskwibox2[s].ontop = false
  1166. mydeskwibox2[s].visible = true
  1167. mydeskwibox2[s]:set_widget(wibox.layout.margin(mydeskwibox2_layout, 10, 10, 10, 10 ))
  1168. -- Create mywibox and set layout
  1169. mylayoutbox[s] = awful.widget.layoutbox(s)
  1170. mylayoutbox[s]:buttons(awful.util.table.join(
  1171. awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end),
  1172. awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end),
  1173. awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
  1174. awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)))
  1175. mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons, {width = 0.800})
  1176. mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons)
  1177. local left_layout = wibox.layout.fixed.horizontal()
  1178. left_layout:add(mylauncher)
  1179. mypromptbox[s] = awful.widget.prompt()
  1180. left_layout:add(mypromptbox[s])
  1181. left_layout:add(mytaglist[s])
  1182. local right_layout = wibox.layout.fixed.horizontal()
  1183. right_layout:add(mylayoutbox[s])
  1184. right_layout:add(spacewidget)
  1185. if s == 1 then
  1186. right_layout:add(wibox.widget.systray())
  1187. end
  1188. right_layout:add(spacewidget)
  1189. right_layout:add(kbdcfg.widget)
  1190. right_layout:add(spacewidget)
  1191. right_layout:add(batwidget)
  1192. right_layout:add(mytextclock)
  1193. right_layout:add(spacewidget)
  1194. local tpanel = wibox.layout.fixed.horizontal()
  1195. tpanel:add(thermalwidget)
  1196. tpanel:add(fanwidget)
  1197. right_layout:add(tpanel)
  1198. local layout = wibox.layout.align.horizontal()
  1199. layout:set_left(left_layout)
  1200. layout:set_middle(mytasklist[s])
  1201. layout:set_right(right_layout)
  1202. mywibox[s] = awful.wibox({ bg = "#000000ff", position = "top", height = 20, screen = s })
  1203. mywibox[s]:set_widget(layout)
  1204. mwbv={true, true, true, true, true, true}
  1205. current=1
  1206. mywibox[s].visible = mwbv[current]
  1207. -- Create mywibox1 and set layout
  1208.  
  1209.  
  1210. tags[s][1]:connect_signal("property::selected",
  1211. function(tag)
  1212. if not tag.selected then return end
  1213. current=1
  1214. mywibox[s].visible = mwbv[current]
  1215. mydeskwibox[s]:set_widget(wibox.layout.margin(mydeskwibox_1_layout, 10, 10, 30, 10 ))
  1216. awful.util.spawn_with_shell('wallpaper.sh picture')
  1217. end)
  1218. tags[s][2]:connect_signal("property::selected",
  1219. function(tag)
  1220. if not tag.selected then return end
  1221. current=2
  1222. mywibox[s].visible = mwbv[current]
  1223. mydeskwibox[s]:set_widget(wibox.layout.margin(mydeskwibox_2_layout, 10, 10, 30, 10 ))
  1224. awful.util.spawn_with_shell('wallpaper.sh picture')
  1225. end)
  1226. tags[s][3]:connect_signal("property::selected",
  1227. function(tag)
  1228. if not tag.selected then return end
  1229. current=3
  1230. mywibox[s].visible = mwbv[current]
  1231. mydeskwibox[s]:set_widget(wibox.layout.margin(mydeskwibox_3_layout, 10, 10, 30, 10 ))
  1232. awful.util.spawn_with_shell('wallpaper.sh picture')
  1233. end)
  1234. tags[s][4]:connect_signal("property::selected",
  1235. function(tag)
  1236. if not tag.selected then return end
  1237. current=4
  1238. mywibox[s].visible = mwbv[current]
  1239. mydeskwibox[s]:set_widget(wibox.layout.margin(mydeskwibox_4_layout, 10, 10, 30, 10 ))
  1240. awful.util.spawn_with_shell('wallpaper.sh picture')
  1241. end)
  1242. tags[s][5]:connect_signal("property::selected",
  1243. function(tag)
  1244. if not tag.selected then return end
  1245. current=5
  1246. mywibox[s].visible = mwbv[current]
  1247. mydeskwibox[s]:set_widget(wibox.layout.margin(mydeskwibox_5_layout, 10, 10, 30, 10 ))
  1248. awful.util.spawn_with_shell('wallpaper.sh picture')
  1249. end)
  1250. tags[s][6]:connect_signal("property::selected",
  1251. function(tag)
  1252. if not tag.selected then return end
  1253. current=6
  1254. mywibox[s].visible = mwbv[current]
  1255. mydeskwibox[s]:set_widget(wibox.layout.margin(mydeskwibox_6_layout, 10, 10, 30, 10 ))
  1256. awful.util.spawn_with_shell('wallpaper.sh picture')
  1257. end)
  1258. mydeskwibox[s]:set_widget(wibox.layout.margin(mydeskwibox_1_layout, 10, 10, 30, 10 ))
  1259. end
  1260. -- }}}
  1261.  
  1262. -- {{{ Mouse bindings
  1263. root.buttons(awful.util.table.join(
  1264. awful.button({ }, 3, function () mymainmenu:toggle() end),
  1265. awful.button({ }, 4, awful.tag.viewnext),
  1266. awful.button({ }, 5, awful.tag.viewprev)
  1267. ))
  1268. -- }}}
  1269. -- {{{ Key bindings
  1270. globalkeys = awful.util.table.join(
  1271.  
  1272.  
  1273. awful.key({ }, "#107", function () awful.util.spawn_with_shell('scrot.sh') end),
  1274. awful.key({ modkey, "Shift" }, "#41", function () awful.util.spawn_with_shell('wallpaper.sh f') end),
  1275. awful.key({ modkey, "Shift" }, "#33", function () awful.util.spawn_with_shell('wallpaper.sh pq') end),
  1276. awful.key({ modkey, "Control" }, "#33", function () awful.util.spawn_with_shell('wallpaper.sh pcq') end),
  1277. awful.key({ modkey, "Shift" }, "#56", function () awful.util.spawn_with_shell('wallpaper.sh b') end),
  1278. awful.key({ modkey, "Shift" }, "#26", function () awful.util.spawn_with_shell('wallpaper.sh e') end),
  1279. awful.key({ modkey, "Shift" }, "#46", function () awful.util.spawn_with_shell('wallpaper.sh picture') end),
  1280.  
  1281.  
  1282.  
  1283. awful.key({ modkey, }, "Left", awful.tag.viewprev ),
  1284. awful.key({ modkey, }, "Right", awful.tag.viewnext ),
  1285. awful.key({ modkey, }, "Escape", awful.tag.history.restore),
  1286.  
  1287. awful.key({ }, "XF86AudioMute", function () awful.util.spawn("amixer -D pulse set Master Playback Switch toggle") end),
  1288. awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn("amixer set Master 5%-") end),
  1289. awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn("amixer set Master 5%+") end),
  1290. awful.key({ "Mod1" }, "Shift_L", function () kbdcfg.switch() end),
  1291.  
  1292. awful.key({ modkey, }, "#44",
  1293. function ()
  1294. awful.client.focus.byidx( 1)
  1295. if client.focus then client.focus:raise() end
  1296. end),
  1297. awful.key({ modkey, }, "#45",
  1298. function ()
  1299. awful.client.focus.byidx(-1)
  1300. if client.focus then client.focus:raise() end
  1301. end),
  1302. awful.key({ modkey, }, "#25", function () mymainmenu:show() end),
  1303.  
  1304.  
  1305. awful.key({ modkey }, "#56", function ()
  1306. mywibox[mouse.screen].visible = not mywibox[mouse.screen].visible
  1307. mwbv[current] = not mwbv[current]
  1308. end),
  1309.  
  1310.  
  1311. -- Layout manipulation
  1312. awful.key({ modkey, "Shift" }, "#44", function () awful.client.swap.byidx( 1) end),
  1313. awful.key({ modkey, "Shift" }, "#45", function () awful.client.swap.byidx( -1) end),
  1314. awful.key({ modkey, "Control" }, "#44", function () awful.screen.focus_relative( 1) end),
  1315. awful.key({ modkey, "Control" }, "#45", function () awful.screen.focus_relative(-1) end),
  1316. awful.key({ modkey, }, "#30", awful.client.urgent.jumpto),
  1317. awful.key({ modkey, }, "Tab",
  1318. function ()
  1319. awful.client.focus.history.previous()
  1320. if client.focus then
  1321. client.focus:raise()
  1322. end
  1323. end),
  1324.  
  1325. -- Standard program
  1326. awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end),
  1327. awful.key({ modkey, "Control" }, "#27", awesome.restart),
  1328. awful.key({ modkey, "Shift" }, "#24", awesome.quit),
  1329.  
  1330. awful.key({ modkey, }, "#46", function () awful.tag.incmwfact( 0.05) end),
  1331. awful.key({ modkey, }, "#43", function () awful.tag.incmwfact(-0.05) end),
  1332. awful.key({ modkey, "Shift" }, "#43", function () awful.tag.incnmaster( 1) end),
  1333. awful.key({ modkey, "Shift" }, "#46", function () awful.tag.incnmaster(-1) end),
  1334. awful.key({ modkey, "Control" }, "#43", function () awful.tag.incncol( 1) end),
  1335. awful.key({ modkey, "Control" }, "#46", function () awful.tag.incncol(-1) end),
  1336. awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end),
  1337. awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end),
  1338.  
  1339. awful.key({ modkey, "Control" }, "#57", awful.client.restore),
  1340.  
  1341. -- Prompt
  1342. awful.key({ modkey }, "#27", function () mypromptbox[mouse.screen]:run() end),
  1343.  
  1344. awful.key({ modkey }, "#53",
  1345. function ()
  1346. awful.prompt.run({ prompt = "Run Lua code: " },
  1347. mypromptbox[mouse.screen].widget,
  1348. awful.util.eval, nil,
  1349. awful.util.getdir("cache") .. "/history_eval")
  1350. end),
  1351. -- Menubar
  1352. awful.key({ modkey }, "#33", function() menubar.show() end),
  1353. -- Panels
  1354. -- awful.key({ modkey }, "#55", function()
  1355. -- mywibox[mouse.screen].visible = not mywibox[mouse.screen].visible
  1356. -- end),
  1357. awful.key({ modkey, "Shift" }, "#55", function()
  1358. awful.util.spawn_with_shell("vclip.sh")
  1359. end)
  1360.  
  1361.  
  1362.  
  1363.  
  1364. )
  1365.  
  1366.  
  1367. clientkeys = awful.util.table.join(
  1368. awful.key({ modkey, }, "#41", function (c) c.fullscreen = not c.fullscreen end),
  1369. awful.key({ modkey, "Shift" }, "#54", function (c) c:kill() end),
  1370. awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ),
  1371. awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
  1372. awful.key({ modkey, }, "#32", awful.client.movetoscreen ),
  1373. awful.key({ modkey, }, "#28", function (c) c.ontop = not c.ontop end),
  1374. awful.key({ modkey, }, "#57",
  1375. function (c)
  1376. -- The client currently has the input focus, so it cannot be
  1377. -- minimized, since minimized clients can't have the focus.
  1378. c.minimized = true
  1379. end),
  1380.  
  1381. awful.key({ modkey, "Shift" }, "#57",
  1382. function()
  1383. local tag = awful.tag.selected()
  1384. for i=1, #tag:clients() do
  1385. tag:clients()[i].minimized=false
  1386. -- tag:clients()[i]:redraw()
  1387. end
  1388. end),
  1389.  
  1390.  
  1391. awful.key({ modkey, }, "#58",
  1392. function (c)
  1393. c.maximized_horizontal = not c.maximized_horizontal
  1394. c.maximized_vertical = not c.maximized_vertical
  1395. end)
  1396. )
  1397.  
  1398. -- Bind all key numbers to tags.
  1399. -- Be careful: we use keycodes to make it works on any keyboard layout.
  1400. -- This should map on the top row of your keyboard, usually 1 to 9.
  1401. for i = 1, 9 do
  1402. globalkeys = awful.util.table.join(globalkeys,
  1403. -- View tag only.
  1404. awful.key({ modkey }, "#" .. i + 9,
  1405. function ()
  1406. local screen = mouse.screen
  1407. local tag = awful.tag.gettags(screen)[i]
  1408. if tag then
  1409. awful.tag.viewonly(tag)
  1410. end
  1411. end),
  1412. -- Toggle tag.
  1413. awful.key({ modkey, "Control" }, "#" .. i + 9,
  1414. function ()
  1415. local screen = mouse.screen
  1416. local tag = awful.tag.gettags(screen)[i]
  1417. if tag then
  1418. awful.tag.viewtoggle(tag)
  1419. end
  1420. end),
  1421. -- Move client to tag.
  1422. awful.key({ modkey, "Shift" }, "#" .. i + 9,
  1423. function ()
  1424. if client.focus then
  1425. local tag = awful.tag.gettags(client.focus.screen)[i]
  1426. if tag then
  1427. awful.client.movetotag(tag)
  1428. end
  1429. end
  1430. end),
  1431. -- Toggle tag.
  1432. awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
  1433. function ()
  1434. if client.focus then
  1435. local tag = awful.tag.gettags(client.focus.screen)[i]
  1436. if tag then
  1437. awful.client.toggletag(tag)
  1438. end
  1439. end
  1440. end))
  1441. end
  1442.  
  1443. clientbuttons = awful.util.table.join(
  1444. awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
  1445. awful.button({ modkey }, 1, awful.mouse.client.move),
  1446. awful.button({ modkey }, 3, awful.mouse.client.resize))
  1447.  
  1448. -- Set keys
  1449. root.keys(globalkeys)
  1450. -- }}}
  1451.  
  1452. -- beautiful.border_width = 0
  1453. -- {{{ Rules
  1454. -- Rules to apply to new clients (through the "manage" signal).
  1455. awful.rules.rules = {
  1456. -- All clients will match this rule.
  1457. { rule = { },
  1458. properties = { border_width = beautiful.border_width,
  1459. border_color = beautiful.border_normal,
  1460. focus = awful.client.focus.filter,
  1461. raise = true,
  1462. keys = clientkeys,
  1463. size_hints_honor = false,
  1464. buttons = clientbuttons } },
  1465. { rule = { class = "mplayer2" },
  1466. properties = { floating = true },
  1467. { tag = tags[1][6] }
  1468. },
  1469. { rule = { class = "pinentry" },
  1470. properties = { floating = true } },
  1471. { rule = { class = "gimp" },
  1472. properties = { floating = true } },
  1473. -- Set Firefox to always map on tags number 2 of screen 1.
  1474. -- { rule = { class = "Firefox" },
  1475. -- properties = { tag = tags[1][2] } },
  1476.  
  1477.  
  1478. { rule = { class = "URxvt" },
  1479. properties = { tag = tags[1][1],
  1480. -- floating = true,
  1481. fullscreen = true,
  1482. -- skip_taskbar = true,
  1483. -- width = 1366,
  1484. -- height = 728
  1485. -- maximized_vertical = true,
  1486. -- maximized_horizontal = true,
  1487. -- below = true,
  1488. },
  1489. },
  1490.  
  1491. { rule = { class = "Seamonkey", role = "browser" },
  1492. properties = { tag = tags[1][2] },
  1493.  
  1494. },
  1495. { rule = { class = "Seamonkey", role = "3pane" },
  1496. properties = { tag = tags[1][3] } },
  1497. { rule = { class = "Pidgin" },
  1498. properties = { tag = tags[1][3] } },
  1499.  
  1500. { rule = { class = "trayer" },
  1501. properties = { border_width = 0 } },
  1502.  
  1503.  
  1504. }
  1505. -- }}}
  1506.  
  1507. -- {{{ Signals
  1508. -- Signal function to execute when a new client appears.
  1509.  
  1510. client.connect_signal("property::maximized", function(c)
  1511. c.border_width = c.maximized and 0 or beautiful.border_width
  1512. end)
  1513.  
  1514. -- client.connect_signal("focus",
  1515. -- function(c)
  1516. -- if c.maximized_horizontal == true and c.maximized_vertical == true then
  1517. -- c.border_width = "0"
  1518. -- c.border_color = beautiful.border_focus
  1519. -- else
  1520. -- c.border_width = beautiful.border_width
  1521. -- c.border_color = beautiful.border_focus
  1522. -- end
  1523. -- end)
  1524.  
  1525.  
  1526.  
  1527. client.connect_signal("manage", function (c, startup)
  1528. -- Enable sloppy focus
  1529. c:connect_signal("mouse::enter", function(c)
  1530. if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
  1531. and awful.client.focus.filter(c) then
  1532. client.focus = c
  1533. end
  1534. end)
  1535.  
  1536. if not startup then
  1537. -- Set the windows at the slave,
  1538. -- i.e. put it at the end of others instead of setting it master.
  1539. -- awful.client.setslave(c)
  1540.  
  1541. -- Put windows in a smart way, only if they does not set an initial position.
  1542. if not c.size_hints.user_position and not c.size_hints.program_position then
  1543. awful.placement.no_overlap(c)
  1544. awful.placement.no_offscreen(c)
  1545. end
  1546. elseif not c.size_hints.user_position and not c.size_hints.program_position then
  1547. -- Prevent clients from being unreachable after screen count change
  1548. awful.placement.no_offscreen(c)
  1549. end
  1550.  
  1551. local titlebars_enabled = false
  1552. if titlebars_enabled and (c.type == "normal" or c.type == "dialog") then
  1553. -- buttons for the titlebar
  1554. local buttons = awful.util.table.join(
  1555. awful.button({ }, 1, function()
  1556. client.focus = c
  1557. c:raise()
  1558. awful.mouse.client.move(c)
  1559. end),
  1560. awful.button({ }, 3, function()
  1561. client.focus = c
  1562. c:raise()
  1563. awful.mouse.client.resize(c)
  1564. end)
  1565. )
  1566.  
  1567. -- Widgets that are aligned to the left
  1568. local left_layout = wibox.layout.fixed.horizontal()
  1569. left_layout:add(awful.titlebar.widget.iconwidget(c))
  1570. left_layout:buttons(buttons)
  1571.  
  1572. -- Widgets that are aligned to the right
  1573. local right_layout = wibox.layout.fixed.horizontal()
  1574. right_layout:add(awful.titlebar.widget.floatingbutton(c))
  1575. right_layout:add(awful.titlebar.widget.maximizedbutton(c))
  1576. right_layout:add(awful.titlebar.widget.stickybutton(c))
  1577. right_layout:add(awful.titlebar.widget.ontopbutton(c))
  1578. right_layout:add(awful.titlebar.widget.closebutton(c))
  1579.  
  1580. -- The title goes in the middle
  1581. local middle_layout = wibox.layout.flex.horizontal()
  1582. local title = awful.titlebar.widget.titlewidget(c)
  1583. title:set_align("center")
  1584. middle_layout:add(title)
  1585. middle_layout:buttons(buttons)
  1586.  
  1587. -- Now bring it all together
  1588. local layout = wibox.layout.align.horizontal()
  1589. layout:set_left(left_layout)
  1590. layout:set_right(right_layout)
  1591. layout:set_middle(middle_layout)
  1592.  
  1593. awful.titlebar(c):set_widget(layout)
  1594. end
  1595. end)
  1596.  
  1597. client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
  1598. client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
  1599. -- }}}
  1600.  
  1601. awful.util.spawn_with_shell('setxkbmap -layout "us,ru(winkeys)" -model "pc105" -option "grp:alt_shift_toggle,grp_led:scroll,compose:ralt"')
  1602. awful.util.spawn_with_shell('xsetroot -solid "#000000"')
  1603. awful.util.spawn_with_shell("xset -dpms")
  1604. awful.util.spawn_with_shell("xset s off")
  1605. awful.util.spawn_with_shell("xscreensaver -nosplash")
  1606. awful.util.spawn_with_shell("xbacklight -set 50")
  1607. awful.util.spawn_with_shell("~/.fehbg")
  1608. awful.util.spawn_with_shell("xrdb -merge ~/.Xresources")
  1609. awful.util.spawn_with_shell("sleep 1;run_once compton")
  1610. awful.util.spawn_with_shell("run_once caffeine-indicator")
  1611. -- awful.util.spawn_with_shell("killall clipit;clipit -n")
  1612. awful.util.spawn_with_shell("run_once clipit")
  1613. -- awful.util.spawn_with_shell("run_once xxkb")
  1614. awful.util.spawn_with_shell("run_once volti")
  1615.  
  1616. awful.util.spawn_with_shell("synclient TapButton1=1")
  1617. awful.util.spawn_with_shell("synclient VertScrollDelta=-111")
  1618. awful.util.spawn_with_shell("synclient HorizScrollDelta=-111")
  1619. awful.util.spawn_with_shell("synclient RightButtonAreaTop=4500")
  1620. awful.util.spawn_with_shell("synclient MaxDoubleTapTime=175")
  1621. awful.util.spawn_with_shell("synclient MaxTapTime=110")
  1622. awful.util.spawn_with_shell("synclient MaxTapMove=300")
  1623. awful.util.spawn_with_shell("synclient TapButton2=2")
  1624. awful.util.spawn_with_shell("synclient TapButton3=3")
  1625. awful.util.spawn_with_shell("synclient SingleTapTimeout=150")
  1626. awful.util.spawn_with_shell("synclient MaxTapMove=75")
  1627. awful.util.spawn_with_shell("TapAndDragGesture=0")
  1628. awful.util.spawn_with_shell("synclient ClickTime=100")
  1629. awful.util.spawn_with_shell("synclient EmulateMidButtonTime=100")
  1630. awful.util.spawn_with_shell("synclient FingerHigh=100")
  1631. awful.util.spawn_with_shell("synclient FingerLow=20")
  1632. awful.util.spawn_with_shell("synclient MinSpeed=0.3")
  1633. awful.util.spawn_with_shell("synclient MaxSpeed=1.5")
  1634. awful.util.spawn_with_shell("synclient AccelFactor=0.5")
  1635. awful.util.spawn_with_shell("PressureMotionMinZ=15")
  1636.  
  1637. awful.util.spawn_with_shell('xinput set-int-prop "SynPS/2 Synaptics TouchPad" "Synaptics Two-Finger Width" 32 8')
  1638. awful.util.spawn_with_shell("xinput --set-button-map 'SynPS/2 Synaptics TouchPad' 1 2 3 5 4")
  1639. awful.util.spawn_with_shell('/opt/extras.ubuntu.com/touchpad-indicator/bin/touchpad-indicator')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement