Advertisement
Ebscriptwalker

Untitled

Dec 15th, 2019
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. local awful = require("awful")
  2. local gfs = require("gears.filesystem")
  3. local wibox = require("wibox")
  4. local gears = require("gears")
  5.  
  6.  
  7. local ICON = os.getenv("HOME") .. "/.config/awesome/themes/holo/icons/awesome_icon.png"
  8.  
  9. local atom_shell = awful.widget.prompt()
  10.  
  11. local w = wibox {
  12. bg = '#1e252c',
  13. border_width = 1,
  14. border_color = '#84bd00',
  15. max_widget_size = 500,
  16. ontop = true,
  17. height = 55,
  18. width = 500,
  19. shape = function(cr, width, height)
  20. gears.shape.rounded_rect(cr, width, height, 3)
  21. end
  22. }
  23.  
  24. w:setup {
  25. {
  26. {
  27. image = ICON,
  28. widget = wibox.widget.imagebox,
  29. resize = false
  30. },
  31. id = 'icon',
  32. top = 9,
  33. left = 10,
  34. layout = wibox.container.margin
  35. },
  36. {
  37. layout = wibox.container.margin,
  38. left = 10,
  39. atom_shell,
  40. },
  41. id = 'left',
  42. layout = wibox.layout.fixed.horizontal
  43. }
  44.  
  45. local function launch()
  46. w.visible = true
  47.  
  48. awful.placement.top_right(w, { margins = {top = 55}, parent = awful.screen.focused()})
  49. awful.prompt.run{
  50. prompt = "<b>Atom open</b>: ",
  51. bg_cursor = '#84bd00',
  52. textbox = atom_shell.widget,
  53. history_path = gfs.get_dir('cache') .. '/atom_history',
  54. completion_callback = awful.completion.shell,
  55. exe_callback = function(input_text)
  56. if input_text == 0 then
  57. awful.spawn("atom ")
  58. else
  59. awful.spawn("atom " .. input_text)
  60. end
  61. end,
  62. done_callback = function()
  63. w.visible = false
  64. end
  65. }
  66. end
  67.  
  68. return {
  69. launch = launch
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement