From c6d65d7ead3676b2c9f488ff200c84576a484931 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Thu, 25 Jul 2019 17:21:34 +0200 Subject: [PATCH] Add auto starting screenshot utility (configurable) --- default_config.lua | 6 ++++-- rc.lua | 11 ++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/default_config.lua b/default_config.lua index 663abbd..a8fa736 100644 --- a/default_config.lua +++ b/default_config.lua @@ -15,7 +15,9 @@ config.terminal = "terminator" -- Change to gears.filesystem.get_themes_dir() .. "default/theme.lua" to use default awesome theme config.theme = awful.util.getdir("config") .. "/default_theme.lua" -config.screenshotCmd = "flameshot gui" +config.screenshot_utility_command = "flameshot gui" +config.screenshot_utility_auto_start = true +config.screenshot_utility_auto_start_command = "flameshot" config.kbSwitchCmd = "setxkbmap" config.kbLayouts = { "fr", "us" } @@ -27,4 +29,4 @@ config.windowSwitcher = "rofi -show window -config " .. awful.util.getdir("confi config.volume_osd_timeout = 2 -return config \ No newline at end of file +return config diff --git a/rc.lua b/rc.lua index 45cc92e..6b61756 100644 --- a/rc.lua +++ b/rc.lua @@ -64,11 +64,16 @@ local tiling = require("tiling") -- Network widget if os.execute("nm-applet --help") == true then - os.execute("nm-applet &") + awful.spawn("nm-applet") else -- Support for more network managers should be requested via issues end +-- Screenshot auto launch +if config.screenshot_utility_auto_start then + awful.spawn(config.screenshot_utility_auto_start_command) +end + -- This is used later as the default terminal and editor to run. editor = os.getenv("EDITOR") or "nano" editor_cmd = config.terminal .. " -e " .. editor @@ -428,8 +433,8 @@ globalkeys = gears.table.join( awful.key({ "Shift" }, "Alt_L", function () kbdlayout.switch() end, {description = "switch keyboard layout"}), -- Flameshot - awful.key({}, "Print", function () os.execute( config.screenshotCmd ) end, - {description = "screenshot using the specified command"}), + awful.key({}, "Print", function () os.execute(config.screenshot_utility_command) end, + {description = "Take a screenshot using the screenshot utility", group="utilities"}), -- Media control awful.key({}, "XF86AudioPlay", media_control.playPause, {description = "Toggle Play / Pause", group="media control"}),