Commits

Alex V. Koval  committed 9315e69

replace `import` with `scrot`

  • Participants
  • Parent commits 5aa1046

Comments (0)

Files changed (1)

File screenshot.py

 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
+""" Use in i3wm with:
+bindsym --release Print exec --no-startup-id screenshot.py
+"""
+
+
 import os
 from subprocess import Popen, PIPE
 from tempfile import NamedTemporaryFile
 
+SCREENSHOT_UTILITY = '/usr/bin/scrot -s' # /usr/bin/import
+
 def feed_xclipboard(str):
     pipe = Popen("xclip -sel clip", shell=True, stdin=PIPE).stdin
     pipe.write(str)
         prefix='screenshot_',
         dir = os.path.expanduser('~/tmp'),
         delete=False).name
-    p = Popen("/usr/bin/import " + filename, shell=True)
+    p = Popen(SCREENSHOT_UTILITY + " " + filename, shell=True)
     sts = os.waitpid(p.pid, 0)[1]
     return filename