okshot 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.org +19 -86
- data/bin/take_screenshot.sh +3 -1
- data/lib/ok/shot.rb +9 -1
- data/lib/ok/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 662c261d79f519a7aea72744143f0ed3a05b0f4a5051deb205e06209689f031b
|
|
4
|
+
data.tar.gz: 416b7c053d9528b91ba94d0f74b65fd5230b79dcf2136b198fa9281c6f0d3018
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 20bd1a5dd9b717c4f1e32bda9932e49696e6bf7dc27a67e194eed9b3d9b37827a8d63d917e73d2fe1fc17884289f3a71ef01187731a00b2c5113ea8802ab7782
|
|
7
|
+
data.tar.gz: 20325ee6c378d621c19cebf139484e109f8d8c5c31f81f424f829bdf4ab8110b9bba5ca30c9504b2fcd6e40243a34413f86cbd3ea394301c67820ee7b59fba07
|
data/README.org
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
\___/|_|\_\___/_| |_|\___/ \__|
|
|
7
7
|
#+end_example
|
|
8
8
|
|
|
9
|
-
#+html: <img src="https://github.com/200ok-ch/okshot/workflows/CI/badge.svg"/>
|
|
9
|
+
# #+html: <img src="https://github.com/200ok-ch/okshot/workflows/CI/badge.svg"/>
|
|
10
10
|
#+html: <a href="https://rubygems.org/gems/okshot"> <img src="https://badge.fury.io/rb/okshot.svg"/></a>
|
|
11
11
|
|
|
12
12
|
* NAME
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
#+begin_example
|
|
19
19
|
Usage: okshot [options]
|
|
20
|
+
-s, --simple Take a screenshot without annotation and upload
|
|
20
21
|
-c, --copy-clipboard Copy PNG file from clipboard and upload
|
|
21
22
|
-i, --inkscape Use inkscape to edit the screenshot and upload
|
|
22
23
|
#+end_example
|
|
@@ -32,8 +33,13 @@ However, it's so very easy to build =okshot=, because
|
|
|
32
33
|
|
|
33
34
|
For uploading the files via FTP, it needs these environment variables set:
|
|
34
35
|
|
|
36
|
+
- OKSHOT_HOST
|
|
37
|
+
- OKSHOT_USER
|
|
38
|
+
- OKSHOT_PASSWORD
|
|
39
|
+
- OKSHOT_URL_PREFIX
|
|
40
|
+
|
|
35
41
|
For example, you can do this in your shell config file (=~/.bashrc=,
|
|
36
|
-
=~/.zshrc=) or
|
|
42
|
+
=~/.zshrc=) or via [[https://200ok.ch/posts/contextual-helpers-with-zsh-hooks.html][sourceme]]. For example:
|
|
37
43
|
|
|
38
44
|
#+begin_example
|
|
39
45
|
export OKSHOT_HOST=ftp.some-server.ch
|
|
@@ -42,87 +48,6 @@ export OKSHOT_PASSWORD=your_password
|
|
|
42
48
|
export OKSHOT_URL_PREFIX=https://okshot.your_domain.ch
|
|
43
49
|
#+end_example
|
|
44
50
|
|
|
45
|
-
* EXAMPLES
|
|
46
|
-
|
|
47
|
-
Add tags to a file. Tags are always unique.
|
|
48
|
-
|
|
49
|
-
#+begin_example
|
|
50
|
-
$ touch foobar
|
|
51
|
-
$ okshot -a tag1 foobar
|
|
52
|
-
$ ls foobar*
|
|
53
|
-
foobar--[tag1]
|
|
54
|
-
$ okshot -a tag2 foobar--\[tag1\]
|
|
55
|
-
$ ls foobar*
|
|
56
|
-
foobar--[tag1,tag2]
|
|
57
|
-
$ okshot -a tag3,tag2 foobar--[tag1,tag2].pdf
|
|
58
|
-
$ ls foobar*
|
|
59
|
-
foobar--[tag1,tag2,tag3].pdf
|
|
60
|
-
#+end_example
|
|
61
|
-
|
|
62
|
-
Delete a tag from a file.
|
|
63
|
-
|
|
64
|
-
#+begin_example
|
|
65
|
-
$ find . | grep business_card | head -n 1
|
|
66
|
-
./archiv/Reto_Huber--[business_card,somedia,seo].pdf
|
|
67
|
-
$ okshot -d seo ./archiv/Reto_Huber--[business_card,somedia,seo].pdf
|
|
68
|
-
$ find . | grep business_card | head -n 1
|
|
69
|
-
./archiv/Reto_Huber--[business_card,somedia].pdf
|
|
70
|
-
#+end_example
|
|
71
|
-
|
|
72
|
-
Interactively add tags (with auto-completion through readline) to a file.
|
|
73
|
-
|
|
74
|
-
#+begin_example
|
|
75
|
-
$ okshot -i foo
|
|
76
|
-
> t[TAB]
|
|
77
|
-
tag1 tag2 tag3
|
|
78
|
-
> tag2, new tag
|
|
79
|
-
$ ls foo* | grep new
|
|
80
|
-
foo--[new_tag,tag2]
|
|
81
|
-
#+end_example
|
|
82
|
-
|
|
83
|
-
List all tags in the current folder.
|
|
84
|
-
|
|
85
|
-
#+begin_example
|
|
86
|
-
$ touch foo
|
|
87
|
-
$ touch bar.txt
|
|
88
|
-
$ touch foobar--[tag1,tag2].pdf
|
|
89
|
-
$ touch baz--[tag1].txt
|
|
90
|
-
$ okshot -l
|
|
91
|
-
tag1(2)
|
|
92
|
-
tag2(1)
|
|
93
|
-
#+end_example
|
|
94
|
-
|
|
95
|
-
List all tags for a given path glob (assuming the same data set as above).
|
|
96
|
-
|
|
97
|
-
#+begin_example
|
|
98
|
-
$ okshot -l '*txt'
|
|
99
|
-
tag1(1)
|
|
100
|
-
#+end_example
|
|
101
|
-
|
|
102
|
-
Rename tag.
|
|
103
|
-
|
|
104
|
-
#+begin_example
|
|
105
|
-
$ okshot -l
|
|
106
|
-
200ok_expense(8)
|
|
107
|
-
business_card(4)
|
|
108
|
-
$ okshot -r 200ok_expense 200ok,expense
|
|
109
|
-
$ okshot -l
|
|
110
|
-
expense(8)
|
|
111
|
-
200ok(8)
|
|
112
|
-
business_card(4)
|
|
113
|
-
#+end_example
|
|
114
|
-
|
|
115
|
-
Search files with tags.
|
|
116
|
-
|
|
117
|
-
#+begin_example
|
|
118
|
-
$ okshot -s somedia,seo,business_card
|
|
119
|
-
archiv/Reto_Huber--[business_card,seo,somedia].pdf
|
|
120
|
-
archiv/Reto_Huber--[business_card,seo,somedia].txt
|
|
121
|
-
$ okshot -s business_card '**/*pdf'
|
|
122
|
-
archiv/Reto_Huber--[business_card,seo,somedia].pdf
|
|
123
|
-
archiv/Stefan_Schmidt--[business_card,lawoon].pdf
|
|
124
|
-
#+end_example
|
|
125
|
-
|
|
126
51
|
* INSTALLATION
|
|
127
52
|
|
|
128
53
|
=okshot= is implemented in [[https://www.ruby-lang.org/en/][Ruby]] and can be installed as a [[https://rubygems.org/][gem]].
|
|
@@ -131,8 +56,13 @@ Search files with tags.
|
|
|
131
56
|
gem install okshot
|
|
132
57
|
#+end_example
|
|
133
58
|
|
|
134
|
-
It assumes you're using the [[https://i3wm.org/][i3wm]] tiling window manager and uses
|
|
135
|
-
standard Linux tools:
|
|
59
|
+
It assumes you're using the [[https://i3wm.org/][i3wm]] tiling window manager and uses
|
|
60
|
+
standard Linux tools. For all flags, it requires:
|
|
61
|
+
|
|
62
|
+
- [[https://imagemagick.org/][imagemagick]]
|
|
63
|
+
- [[https://linux.die.net/man/1/ftp][ftp]]
|
|
64
|
+
|
|
65
|
+
For the flag =-i=, it additionally requires:
|
|
136
66
|
|
|
137
67
|
- [[https://linux.die.net/man/1/wmctrl][wmctrl]]
|
|
138
68
|
- [[https://inkscape.org/][inkscape]]
|
|
@@ -141,7 +71,7 @@ standard Linux tools:
|
|
|
141
71
|
Install dependencies:
|
|
142
72
|
|
|
143
73
|
#+begin_src shell
|
|
144
|
-
apt-get install imagemagick inkscape wmctrl
|
|
74
|
+
apt-get install imagemagick ftp inkscape wmctrl
|
|
145
75
|
#+end_src
|
|
146
76
|
|
|
147
77
|
* DEVELOPMENT
|
|
@@ -162,3 +92,6 @@ the =.gem= file to [[https://rubygems.org][rubygems.org]].
|
|
|
162
92
|
|
|
163
93
|
# Tests are implemented with [[https://rspec.info/][RSpec]] and can be run with =bundle exec
|
|
164
94
|
# rspec spec=.
|
|
95
|
+
* DEMO
|
|
96
|
+
|
|
97
|
+
[[https://github.com/200ok-ch/okshot/wiki/videos/demo.gif]]
|
data/bin/take_screenshot.sh
CHANGED
data/lib/ok/shot.rb
CHANGED
|
@@ -11,7 +11,7 @@ module OK
|
|
|
11
11
|
class Error < StandardError; end
|
|
12
12
|
extend self
|
|
13
13
|
|
|
14
|
-
def take_screenshot
|
|
14
|
+
def take_screenshot(flag)
|
|
15
15
|
bin_dir = File.expand_path(File.join(%w[.. .. .. bin]), __FILE__)
|
|
16
16
|
shell_script_path = File.join(bin_dir, "take_screenshot.sh -#{flag}")
|
|
17
17
|
`#{shell_script_path}`
|
|
@@ -20,6 +20,14 @@ module OK
|
|
|
20
20
|
def main
|
|
21
21
|
OptionParser.new do |opts|
|
|
22
22
|
opts.banner = 'Usage: okshot [options]'
|
|
23
|
+
opts.on(
|
|
24
|
+
'-s',
|
|
25
|
+
'--simple',
|
|
26
|
+
'Take a screenshot without annotation and upload'
|
|
27
|
+
) do |c|
|
|
28
|
+
take_screenshot('s')
|
|
29
|
+
exit
|
|
30
|
+
end
|
|
23
31
|
opts.on(
|
|
24
32
|
'-c',
|
|
25
33
|
'--copy-clipboard',
|
data/lib/ok/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: okshot
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alain M. Lafon
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-01-
|
|
11
|
+
date: 2021-01-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Take and annotate screenshots in Linux with standard tools.
|
|
14
14
|
email:
|
|
@@ -54,8 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
54
54
|
- !ruby/object:Gem::Version
|
|
55
55
|
version: '0'
|
|
56
56
|
requirements: []
|
|
57
|
-
|
|
58
|
-
rubygems_version: 2.7.3
|
|
57
|
+
rubygems_version: 3.0.3
|
|
59
58
|
signing_key:
|
|
60
59
|
specification_version: 4
|
|
61
60
|
summary: Take and annotate screenshots.
|