Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local awful = require("awful")
- local gfs = require("gears.filesystem")
- local wibox = require("wibox")
- local gears = require("gears")
- local ICON = os.getenv("HOME") .. "/.config/awesome/themes/holo/icons/awesome_icon.png"
- local atom_shell = awful.widget.prompt()
- local w = wibox {
- bg = '#1e252c',
- border_width = 1,
- border_color = '#84bd00',
- max_widget_size = 500,
- ontop = true,
- height = 55,
- width = 500,
- shape = function(cr, width, height)
- gears.shape.rounded_rect(cr, width, height, 3)
- end
- }
- w:setup {
- {
- {
- image = ICON,
- widget = wibox.widget.imagebox,
- resize = false
- },
- id = 'icon',
- top = 9,
- left = 10,
- layout = wibox.container.margin
- },
- {
- layout = wibox.container.margin,
- left = 10,
- atom_shell,
- },
- id = 'left',
- layout = wibox.layout.fixed.horizontal
- }
- local function launch()
- w.visible = true
- awful.placement.top_right(w, { margins = {top = 55}, parent = awful.screen.focused()})
- awful.prompt.run{
- prompt = "<b>Atom open</b>: ",
- bg_cursor = '#84bd00',
- textbox = atom_shell.widget,
- history_path = gfs.get_dir('cache') .. '/atom_history',
- completion_callback = awful.completion.shell,
- exe_callback = function(input_text)
- if input_text == 0 then
- awful.spawn("atom ")
- else
- awful.spawn("atom " .. input_text)
- end
- end,
- done_callback = function()
- w.visible = false
- end
- }
- end
- return {
- launch = launch
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement