Advertisement
voyeg3r

awesome-scratchpad.lua

Sep 1st, 2022
1,701
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.21 KB | None | 0 0
  1. -- awesomewm scratchpad terminal
  2. -- clone this repo into your ~/.config/awesome:
  3. -- git clone https://github.com/notnew/awesome-scratch ~/.config/awesome
  4.  
  5. --TOP OF FILE
  6. local scratch = require("awesome-scratch.scratch")
  7. screen_width = awful.screen.focused().geometry.width
  8. screen_height = awful.screen.focused().geometry.height
  9.  
  10. --KEYBIND
  11.   -- open scratchpad
  12. awful.key({ modkey }, "d", function ()
  13.     scratch.toggle("st -n scratch", { instance = "scratch" })
  14.   end,
  15.     { description = "Open scratchpad terminal" , group = "term" }
  16.   ),
  17.  
  18. -- RULE
  19.     {
  20.         rule_any = {
  21.             instance = { "scratch" },
  22.             class = { "scratch" },
  23.             icon_name = { "scratchpad_urxvt" },
  24.         },
  25.         properties = {
  26.             skip_taskbar = false,
  27.             floating = true,
  28.             ontop = false,
  29.             minimized = true,
  30.             sticky = false,
  31.             width = screen_width * 0.7,
  32.             height = screen_height * 0.75
  33.         },
  34.         callback = function (c)
  35.             awful.placement.centered(c,{honor_padding = true, honor_workarea=true})
  36.             gears.timer.delayed_call(function()
  37.                 c.urgent = false
  38.             end)
  39.         end
  40.     },
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement