Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local gears = require("gears")
- local awful = require("awful")
- local scratch = require("scratch")
- local bindings = require("bindings")
- local wibox = require("wibox")
- local beautiful = require("beautiful")
- local logout_menu_widget = require("logout_menu")
- local menubar = require("menubar")
- require("awful.autofocus")
- require("awful.hotkeys_popup.keys")
- screen_width = awful.screen.focused().geometry.width
- screen_height = awful.screen.focused().geometry.height
- terminal = "kitty"
- editor = "nano"
- editor_cmd = terminal .. " -e " .. editor
- root.keys(bindings.keyboard.global)
- mytextclock = wibox.widget.textclock()
- mykeyboardlayout = awful.widget.keyboardlayout()
- menubar.utils.terminal = terminal
- beautiful.init("/home/haissam/.config/awesome/theme.lua")
- awful.layout.layouts = { awful.layout.suit.spiral }
- local tasklist_buttons = gears.table.join(
- awful.button({ }, 1, function (c)
- if c == client.focus then
- c.minimized = true
- else
- c:emit_signal(
- "request::activate",
- "tasklist",
- {raise = true}
- )
- end
- end),
- awful.button({ }, 3, function()
- awful.menu.client_list({ theme = { width = 250 } })
- end),
- awful.button({ }, 4, function ()
- awful.client.focus.byidx(1)
- end),
- awful.button({ }, 5, function ()
- awful.client.focus.byidx(-1)
- end))
- awful.screen.connect_for_each_screen(function(s)
- awful.tag({ " ", " ", " ", " ", " ", " ", " "}, s, awful.layout.layouts[1])
- apps = awful.popup {
- widget = awful.widget.tasklist {
- screen = screen[1],
- filter = awful.widget.tasklist.filter.allscreen,
- buttons = tasklist_buttons,
- style = {
- shape = gears.shape.partially_rounded_rect,
- },
- widget_template = {
- {
- {
- id = 'clienticon',
- widget = awful.widget.clienticon,
- },
- margins = 5,
- widget = wibox.container.margin,
- },
- id = 'background_role',
- forced_width = 48,
- forced_height = 48,
- widget = wibox.container.background,
- create_callback = function(self, c)
- self:get_children_by_id('clienticon')[1].client = c
- end,
- },
- },
- border_width = 0,
- visible = false,
- ontop = true,
- placement = awful.placement.centered,
- shape = gears.shape.partially_rounded_rect
- }
- ---------------------------------------------------------- BAR ---------------------------------------------------------
- s.mywibox = awful.wibar({ position = "top", screen = s, opacity = 0.65, fg = beautiful.white, height = 25})
- s.mytaglist = awful.widget.taglist {
- screen = s,
- filter = awful.widget.taglist.filter.all,
- style = {
- shape = gears.shape.powerline
- },
- layout = {
- spacing = -12,
- spacing_widget = {
- color = beautiful.white,
- shape = gears.shape.powerline,
- widget = wibox.widget.separator,
- },
- layout = wibox.layout.fixed.horizontal
- },
- widget_template = {
- {
- {
- {
- id = 'text_role',
- widget = wibox.widget.textbox,
- },
- layout = wibox.layout.fixed.horizontal,
- },
- left = 30,
- right = 36,
- widget = wibox.container.margin
- },
- id = 'background_role',
- widget = wibox.container.background,
- },
- }
- s.mywibox:setup {
- layout = wibox.layout.align.horizontal,
- {
- layout = wibox.layout.fixed.horizontal,
- s.mytaglist,
- },
- s.mytasklist, -- Middle widget / only here for gap
- {
- layout = wibox.layout.fixed.horizontal,
- spacing = 5,
- mytextclock,
- logout_menu_widget(),
- },
- }
- end)
- month_calendar = require("calendar")
- month_calendar:attach(mytextclock, "tr")
- ------------------------------------------------- DEFAULT CLIENTS RULES ------------------------------------------------
- awful.rules.rules = {
- { rule = {},
- properties = { border_width = beautiful.border_width,
- border_color = beautiful.border_normal,
- focus = awful.client.focus.filter,
- raise = true,
- keys = bindings.keyboard.client,
- buttons = bindings.clientbuttons,
- screen = awful.screen.preferred,
- placement = awful.placement.no_overlap+awful.placement.no_offscreen,
- }
- },
- --------------------------------------------------- SCRATCHPAD RULES ---------------------------------------------------
- { rule_any = {class = {"discord", "kitty"}},
- instance = { "scratch" },
- properties = { skip_taskbar = true, titlebars_enabled = false, floating = true, ontop = true, minimized = true,
- sticky = true, width = screen_width * 0.65, height = screen_height * 0.65
- },
- callback = function (c)
- awful.placement.centered(c,{honor_padding = true, honor_workarea=true})
- gears.timer.delayed_call(function()
- c.urgent = false
- c.border_width = 1
- end)
- end
- },
- ------------------------------------------------------ TAGS RULES ------------------------------------------------------
- {rule_any = {class = {"Termite"}},
- properties = {tag = " ", skip_taskbar = true, titlebars_enabled = false, urgent = false },
- },
- {rule_any = {class = {"jetbrains-clion", "Code", "jetbrains-pycharm", "jetbrains-idea", "jetbrains-datagrip"}},
- properties = { tag = " ", switchtotag = true },
- },
- {rule_any = {class = {"Google-chrome"}},
- properties = { tag = " ", switchtotag = true },
- },
- {rule_any = {class = {"Anydesk", "anydesk"}},
- properties = { tag = " " , switchtotag = false, floating = false},
- },
- {rule_any = {class = {"Font-manager", "Thunar"}},
- properties = { tag = " " , switchtotag = false, floating = false},
- },
- {rule_any = {class = {"VirtualBox Manager", "VirtualBox Machine"}},
- properties = { tag = " " , switchtotag = true, floating = false, fullscreen = true},
- },
- {rule_any = {class = {"steam", "steam_app_1449850"}},
- properties = { tag = " " , switchtotag = true},
- },
- }
- ------------------------------------------------- DEFAULT CLIENTS RULES ------------------------------------------------
- awful.rules.rules = {
- { rule = {},
- properties = { border_width = beautiful.border_width,
- border_color = beautiful.border_normal,
- focus = awful.client.focus.filter,
- raise = true,
- keys = bindings.keyboard.client,
- buttons = bindings.clientbuttons,
- screen = awful.screen.preferred,
- placement = awful.placement.no_overlap+awful.placement.no_offscreen,
- }
- },
- --------------------------------------------------- SCRATCHPAD RULES ---------------------------------------------------
- { rule_any = {class = {"discord", "kitty"}},
- instance = { "scratch" },
- properties = { skip_taskbar = true, titlebars_enabled = false, floating = true, ontop = true, minimized = true,
- sticky = true, width = screen_width * 0.65, height = screen_height * 0.65
- },
- callback = function (c)
- awful.placement.centered(c,{honor_padding = true, honor_workarea=true})
- gears.timer.delayed_call(function()
- c.urgent = false
- c.border_width = 1
- end)
- end
- },
- ------------------------------------------------------ TAGS RULES ------------------------------------------------------
- {rule_any = {class = {"Termite"}},
- properties = {tag = " ", skip_taskbar = true, titlebars_enabled = false, urgent = false },
- },
- {rule_any = {class = {"jetbrains-clion", "Code", "jetbrains-pycharm", "jetbrains-idea", "jetbrains-datagrip"}},
- properties = { tag = " ", switchtotag = true },
- },
- {rule_any = {class = {"Google-chrome"}},
- properties = { tag = " ", switchtotag = true },
- },
- {rule_any = {class = {"Anydesk", "anydesk"}},
- properties = { tag = " " , switchtotag = false, floating = false},
- },
- {rule_any = {class = {"Font-manager", "Thunar"}},
- properties = { tag = " " , switchtotag = false, floating = false},
- },
- {rule_any = {class = {"VirtualBox Manager", "VirtualBox Machine"}},
- properties = { tag = " " , switchtotag = true, floating = false, fullscreen = true},
- },
- {rule_any = {class = {"steam", "steam_app_1449850"}},
- properties = { tag = " " , switchtotag = true},
- },
- }
- ------------------------------------------------------------------------------------------------------------------------
- client.connect_signal("manage", function (c)
- if awesome.startup
- and not c.size_hints.user_position
- and not c.size_hints.program_position then
- awful.placement.no_offscreen(c)
- end
- end)
- client.connect_signal("mouse::enter", function(c)
- c:emit_signal("request::activate", "mouse_enter", {raise = false})
- end)
- client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
- client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
- client.connect_signal("property::floating", function(c)
- if c.floating then
- beautiful.border_width = 0
- end
- end)
- --------------------------------------------------- LAUNCH AT STARTUP --------------------------------------------------
- awful.spawn.single_instance(terminal,{{class = "kitty"}, instance = { "scratch" }, hidden = true, raise = false})
- awful.spawn.once("discord",{{class = "discord"}, instance = { "scratch" }, hidden = true, raise = false})
- awful.spawn.single_instance("picom")
- awful.spawn.single_instance("nitrogen --random --set-tiled")
- awful.spawn.with_shell
- ("termite -e 'cmatrix -b' & sleep 1 && termite --config /etc/xdg/termite/config -e btop & sleep 1 && termite --config /etc/xdg/termite/config -e lf")
- awful.spawn.once("anydesk", {hidden = true})
Add Comment
Please, Sign In to add comment