screenshot to clip

This commit is contained in:
vrd
2026-07-30 11:54:49 +03:00
committed by Venelin Dechkov
parent c626039502
commit 47306a4169
3 changed files with 11 additions and 3 deletions
+1 -2
View File
@@ -68,7 +68,6 @@ static const Layout layouts[] = {
// static const char* dmenucmd[] = { "dmenu_run", "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
static const char* dmenucmd[] = { "dmenu_run", NULL };
static const char* termcmd[] = { "st", NULL };
static const char* screenshot [] = { "scrot", "-s", SCREEN_CAPS_DIR, NULL };
#if HAS_SW_BACKLIGHT
static const char* bright_up[] = { "brightnessctl", "s", "-q", "3%+", NULL };
static const char* bright_down[] = { "brightnessctl", "s", "-q", "3%-", NULL };
@@ -80,7 +79,7 @@ static void webbookmark(const Arg* unused){
static const Key keys[] = {
/* modifier key function argument */
{ MODKEY|ShiftMask, XK_s, spawn, {.v = screenshot } }, //Take a screenshot
{ MODKEY|ShiftMask, XK_s, vene_screenshot, {0} }, // Take a screenshot, located in ~/screenshots and in clipboard
{ MODKEY|ShiftMask, XK_b, webbookmark, {0} }, // Open a web bookmark
{ 0, XF86XK_AudioRaiseVolume, vene_inc_vol, {0} },
{ 0, XF86XK_AudioLowerVolume, vene_dec_vol, {0} },
+8
View File
@@ -248,6 +248,14 @@ extern "C"
}
}
void vene_screenshot(const Arg*)
{
Cmd scrot("scrot", "-s");
Cmd tee("tee", SCREEN_CAPS_DIR);
Cmd xclip("xclip", "-selection", "clipboard", "-t", "image/png");
scrot | tee | xclip; // todo: cppipe < string
}
void vene_browser(const Arg* browser_tag)
{
bool browser_tag_used = false;
+1
View File
@@ -15,6 +15,7 @@ void vene_setup();
void vene_updatestatus(char status[]);
void vene_run();
void vene_screenshot(const Arg*);
void vene_browser(const Arg*);
void vene_webbookmark();
void vene_inc_vol(const Arg*);