Added lpr screenshot action
This commit is contained in:
		| @ -1,9 +1,8 @@ | ||||
|  | ||||
| local script = conf_dir .. "modules/screenshot/screenshot.fish" | ||||
| script = script .. " " | ||||
|  | ||||
| local function screenshot_action(mode) | ||||
| 	awful.spawn(script .. mode, false) | ||||
| 	awful.spawn( | ||||
| 		conf_dir .. "modules/screenshot/screenshot.fish " .. mode, | ||||
| 		false | ||||
| 	) | ||||
| end | ||||
|  | ||||
|  | ||||
| @ -32,15 +31,15 @@ return { | ||||
| 		), | ||||
|  | ||||
| 		awful.key( {"Control"}, "Print", | ||||
| 		function () | ||||
| 			screenshot_action("ocr-eng") | ||||
| 		end, | ||||
| 			function () | ||||
| 				screenshot_action("ocr-eng") | ||||
| 			end, | ||||
|  | ||||
| 		{ | ||||
| 			description = "OCR Capture (English)", | ||||
| 			group = "Screenshot" | ||||
| 		} | ||||
| 	), | ||||
| 			{ | ||||
| 				description = "OCR Capture (English)", | ||||
| 				group = "Screenshot" | ||||
| 			} | ||||
| 		), | ||||
|  | ||||
| 		awful.key( {"Shift"}, "Print", | ||||
| 			function () | ||||
| @ -51,18 +50,17 @@ return { | ||||
| 				description = "Pin a screenshot", | ||||
| 				group = "Screenshot" | ||||
| 			} | ||||
| 		), | ||||
|  | ||||
| 		awful.key( {"Mod1"}, "Print", | ||||
| 			function () | ||||
| 				-- Make sure your default printer is set in CUPS! | ||||
| 				screenshot_action("lpr") | ||||
| 			end, | ||||
| 			{ | ||||
| 				description = "Print a screenshot", | ||||
| 				group = "Screenshot" | ||||
| 			} | ||||
| 		) | ||||
| 	), | ||||
|  | ||||
| 	awful.key( {"Shift", "Control", "Mod1"}, "Print", | ||||
| 		function () | ||||
| 			-- Make sure your default printer is set in CUPS! | ||||
| 			screenshot_action("lpr") | ||||
| 		end, | ||||
|  | ||||
| 		{ | ||||
| 			description = "Print a screenshot", | ||||
| 			group = "Screenshot" | ||||
| 		} | ||||
| 	) | ||||
| } | ||||
|  | ||||
| @ -45,7 +45,7 @@ function capture | ||||
|  | ||||
| 		case lpr | ||||
| 			# Default printer must be set for the lpr command to work. | ||||
| 		 | ||||
|  | ||||
| 			# TODO: don't lpr if screenshot is cancelled. | ||||
| 			flameshot gui --accept-on-select --path $tmp_file | ||||
| 			convert $tmp_file $tmp_file.pdf | ||||
|  | ||||
		Reference in New Issue
	
	Block a user