From d35775653271e1fdd0650644bfa3372ee176876d Mon Sep 17 00:00:00 2001 From: rxyhn Date: Sun, 27 Feb 2022 00:45:28 +0700 Subject: [PATCH] refactor: dotfiles --- config/awesome/configuration/bling.lua | 7 +-- config/awesome/configuration/init.lua | 3 - config/awesome/configuration/keys.lua | 14 ++--- config/awesome/configuration/ruled.lua | 4 +- config/awesome/configuration/scratchpad.lua | 55 ------------------- .../ui/{pop => widgets}/window_switcher.lua | 0 6 files changed, 7 insertions(+), 76 deletions(-) delete mode 100644 config/awesome/configuration/scratchpad.lua rename config/awesome/ui/{pop => widgets}/window_switcher.lua (100%) diff --git a/config/awesome/configuration/bling.lua b/config/awesome/configuration/bling.lua index fca53c7..6a70be2 100644 --- a/config/awesome/configuration/bling.lua +++ b/config/awesome/configuration/bling.lua @@ -52,9 +52,4 @@ bling.widget.task_preview.enable { end } -awful.keyboard.append_global_keybindings({ - awful.key({modkey}, "d", function() awful.spawn(launcher) end, - {description = "show app launcher", group = "launcher"}), -}) - -require('ui.pop.window_switcher').enable() +require('ui.widgets.window_switcher').enable() diff --git a/config/awesome/configuration/init.lua b/config/awesome/configuration/init.lua index cbaebae..cbf8a79 100644 --- a/config/awesome/configuration/init.lua +++ b/config/awesome/configuration/init.lua @@ -46,6 +46,3 @@ require("configuration.ruled") -- Layouts and Window Stuff require("configuration.window") - --- Scratchpad -require("configuration.scratchpad") diff --git a/config/awesome/configuration/keys.lua b/config/awesome/configuration/keys.lua index 3e691d0..788cf1f 100644 --- a/config/awesome/configuration/keys.lua +++ b/config/awesome/configuration/keys.lua @@ -136,23 +136,17 @@ awful.keyboard.append_global_keybindings({ {description = "focus the previous screen", group = "screen"}), awful.key({modkey}, "Return", function() awful.spawn(terminal) end, - {description = "open a terminal", group = "launcher"}), + {description = "open terminal", group = "launcher"}), - awful.key({modkey}, "s", - function() awesome.emit_signal("scratch::music") end, - {description = "open music", group = "scratchpad"}), + awful.key({modkey}, "d", function() awful.spawn(launcher) end, + {description = "open applications menu", group = "launcher"}), - awful.key({modkey}, "z", function() - dash_toggle() end, + awful.key({modkey}, "z", function() dash_toggle() end, {description = "Toggle dashboard", group = "launcher"}), awful.key({modkey}, "f", function() awful.spawn(filemanager) end, {description = "open file browser", group = "launcher"}), - awful.key({modkey}, "v", - function() awesome.emit_signal("scratch::chat") end, - {description = "open chats", group = "scratchpad"}), - awful.key({modkey}, "w", function() awful.spawn.with_shell(browser) end, {description = "open firefox", group = "launcher"}), diff --git a/config/awesome/configuration/ruled.lua b/config/awesome/configuration/ruled.lua index 773bdfa..bdc68d4 100644 --- a/config/awesome/configuration/ruled.lua +++ b/config/awesome/configuration/ruled.lua @@ -59,8 +59,8 @@ ruled.client.connect_signal("request::rules", function() id = "center_placement", rule_any = { type = {"dialog"}, - class = {"Steam", "discord", "markdown_input", "scratchpad"}, - instance = {"markdown_input", "scratchpad"}, + class = {"Steam", "discord", "markdown_input"}, + instance = {"markdown_input"}, role = {"GtkFileChooserDialog", "conversation"} }, properties = {placement = awful.placement.center} diff --git a/config/awesome/configuration/scratchpad.lua b/config/awesome/configuration/scratchpad.lua deleted file mode 100644 index 20e4d8a..0000000 --- a/config/awesome/configuration/scratchpad.lua +++ /dev/null @@ -1,55 +0,0 @@ -local bling = require("module.bling") -local beautiful = require("beautiful") -local dpi = beautiful.xresources.apply_dpi -local rubato = require("module.rubato") - -local music_anim = { - x = rubato.timed { - pos = -970, - rate = 120, - easing = rubato.quadratic, - intro = 0.1, - duration = 0.3, - awestore_compat = true - } -} - -local music_scratch = bling.module.scratchpad:new{ - command = music, - rule = {instance = "music"}, - sticky = false, - autoclose = false, - floating = true, - geometry = {x = dpi(10), y = dpi(580), height = dpi(460), width = dpi(960)}, - reapply = true, - rubato = music_anim -} - -awesome.connect_signal("scratch::music", function() music_scratch:toggle() end) - -local chat_anim = { - y = rubato.timed { - pos = 1090, - rate = 120, - easing = rubato.quadratic, - intro = 0.1, - duration = 0.3, - awestore_compat = true - } -} - -local chat_scratch = bling.module.scratchpad:new{ - command = "Discord", - rule = { - -- class = "chat" - class = "discord" - }, - sticky = false, - autoclose = false, - floating = true, - geometry = {x = dpi(460), y = dpi(90), height = dpi(900), width = dpi(1000)}, - reapply = true, - rubato = chat_anim -} - -awesome.connect_signal("scratch::chat", function() chat_scratch:toggle() end) diff --git a/config/awesome/ui/pop/window_switcher.lua b/config/awesome/ui/widgets/window_switcher.lua similarity index 100% rename from config/awesome/ui/pop/window_switcher.lua rename to config/awesome/ui/widgets/window_switcher.lua