desktopen 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +32 -0
  3. data/VERSION +1 -1
  4. data/bin/desktopen +1 -17
  5. data/desktopen.gemspec +54 -0
  6. metadata +5 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 86a058e23c875190ed028da726f4adf2d79ccc01
4
- data.tar.gz: d407ae62f4f66ef3555465285d3dfd583b96ec35
3
+ metadata.gz: c1308955b11c9bbbb36fb6467749bf6c1db9a157
4
+ data.tar.gz: a564b6584014aafdc54b5930a975699db71d26c8
5
5
  SHA512:
6
- metadata.gz: c9ea518a5c2fdc6c28caef50fb32aef2e1392995d022064563349c4ca277bce9ff6f74da9f0328b8c135d28fd7f89f4b53ebf3292300c7b7d500be57610be0c5
7
- data.tar.gz: dc5887574bdfee4b7942df719c48117e1adf0be53dc8bf4056fc444cf3b3aba2d82a7d88128483a0c542cfdabc6d114c656f54fec123d4f2169ed62fc20021f8
6
+ metadata.gz: 7b0edfc387e61a97d15d918a2b47fa58d6ab03a6318b42aa98af65063ba4e362960301c42e05d193fb984c159e7e44a841f8c4b4fec79bdba84c3823bc322e48
7
+ data.tar.gz: 642f2331d59b4ab681938422ab5653564478eaed8ea8de85b75ec3685224daf482c471a39ab591176b6c61aa1be067d4b2b5db22bb1d1348c27123c569fa3250
@@ -0,0 +1,32 @@
1
+ # desktopen
2
+ A simple CLI util to open and position X windows.
3
+
4
+ Everytime a start a computer I had to manually open all my windows: terminal, text editor, browser -
5
+ then put them in proper viewports/displayes and position them. This is tedious work to be avoided.
6
+ Now I just use the following script made possible by `desktopen`:
7
+
8
+ A rather simple script that opens and places various X windows on different viewports and desktops for you.
9
+
10
+ # Chats and email
11
+ desktopen "google-chrome --new-window https://gmail.com" -v 1 --fullscreen
12
+ desktopen "google-chrome --new-window https://web.telegram.org" -v 1 -d 2 -x 447 -y 50 -w 1569 -h 1256
13
+
14
+ # Corporate chats and issue tracking
15
+ desktopen "google-chrome --new-window https://workflowy.com" -v 2 -d 1 -x 3 -y 10 -w 1238 -h 1336
16
+ desktopen "google-chrome --new-window https://mycompany.slack.com/messages/general/" -v 2 -d 1 -x 1269 -y 10 -w 1247 -h 1348
17
+ desktopen "google-chrome --new-window https://mycompany.atlassian.net/issues/" -v 2 -d 2 -x 3 -y 10 -w 1238 -h 1336
18
+
19
+ # Coding
20
+ desktopen 'terminator -m -l "project 1"' -v 6 -d 2 --fullscreen
21
+ desktopen 'gvim -c "cd ~/Work/project-1"' -v 6 -d 1 --fullscreen
22
+ desktopen 'terminator -m -l "project 2"' -v 6 -d 2 --fullscreen
23
+ desktopen 'gvim -c "cd ~/Work/project-2"' -v 6 -d 1 --fullscreen
24
+
25
+ To get a detailed breadkdown of all CLI options, just type `desktopen --help` once you installed it.
26
+
27
+ ## Installation
28
+ `gem install dekstopen`
29
+
30
+ ## Known issues
31
+ * It currently only supports up to 2 displays. Ideally, I'd want it to work with more than 2 monitors, but because I have 2,
32
+ I didn't bother to properly adjust the script.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.5.1
@@ -1,21 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- # This program opens windows and places them in the correct
4
- # positions on correct viewports.
5
- #
6
- # Usage:
7
- #
8
- # owin ["command name --with --all --the args"] [viewport] [ fullscreen | [Width] [Height] [X-pos] [Y-pos] [screen number] ]
9
- #
10
- # How it works:
11
- #
12
- # 1. Gets screen resolution (xrandr)
13
- # 2. Gets the number of viewports
14
- # 3. Calculates 0,0 coordinates for each viewport
15
- #
16
- # 4. Opens the window, get its ID
17
- # 5. Uses wmctrl to set window position
18
-
19
3
  require 'optparse'
20
4
  require_relative '../lib/desktopen'
21
5
 
@@ -67,7 +51,7 @@ pid = spawn("#{ARGV[0]}")
67
51
  # Give the process some time to load, otherwise we can start moving the window before
68
52
  # it's properly opened and this may result in mispositioning.
69
53
  # The sleep time obviously depends on the system, for slower PCs it should be set to a larger number.
70
- sleep options[:repos_timeout] || 1
54
+ sleep options[:repos_timeout].to_i || 1
71
55
 
72
56
  position_and_resize_active_window(
73
57
  window_id: find_opened_window(old_window_ids_list),
@@ -0,0 +1,54 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+ # stub: desktopen 0.5.1 ruby lib
6
+
7
+ Gem::Specification.new do |s|
8
+ s.name = "desktopen"
9
+ s.version = "0.5.1"
10
+
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
13
+ s.authors = ["Roman Snitko"]
14
+ s.date = "2016-04-23"
15
+ s.description = "A simple CLI util to open and position X windows."
16
+ s.email = "roman.snitko@gmail.com"
17
+ s.executables = ["desktopen"]
18
+ s.extra_rdoc_files = [
19
+ "LICENSE.txt",
20
+ "README.md"
21
+ ]
22
+ s.files = [
23
+ ".document",
24
+ "Gemfile",
25
+ "Gemfile.lock",
26
+ "LICENSE.txt",
27
+ "README.md",
28
+ "Rakefile",
29
+ "VERSION",
30
+ "bin/desktopen",
31
+ "desktopen.gemspec",
32
+ "lib/desktopen.rb"
33
+ ]
34
+ s.homepage = "http://github.com/snitko/desktopen"
35
+ s.licenses = ["MIT"]
36
+ s.rubygems_version = "2.4.5"
37
+ s.summary = "A simple CLI util to open and position X windows"
38
+
39
+ if s.respond_to? :specification_version then
40
+ s.specification_version = 4
41
+
42
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
43
+ s.add_development_dependency(%q<bundler>, ["~> 1.0"])
44
+ s.add_development_dependency(%q<jeweler>, ["~> 2.0.1"])
45
+ else
46
+ s.add_dependency(%q<bundler>, ["~> 1.0"])
47
+ s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
48
+ end
49
+ else
50
+ s.add_dependency(%q<bundler>, ["~> 1.0"])
51
+ s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
52
+ end
53
+ end
54
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: desktopen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Snitko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-30 00:00:00.000000000 Z
11
+ date: 2016-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -45,14 +45,17 @@ executables:
45
45
  extensions: []
46
46
  extra_rdoc_files:
47
47
  - LICENSE.txt
48
+ - README.md
48
49
  files:
49
50
  - ".document"
50
51
  - Gemfile
51
52
  - Gemfile.lock
52
53
  - LICENSE.txt
54
+ - README.md
53
55
  - Rakefile
54
56
  - VERSION
55
57
  - bin/desktopen
58
+ - desktopen.gemspec
56
59
  - lib/desktopen.rb
57
60
  homepage: http://github.com/snitko/desktopen
58
61
  licenses: