hiiro 0.1.142 → 0.1.144

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/h-jumplist +27 -3
  3. data/lib/hiiro/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7ed979dfa3dd79763fcec8691a914623e6b4b9d573fa7c5dad02706baa027e20
4
- data.tar.gz: 16b4366eb1e2700d3a9ef7f2225a024d7757b76b837631467d31db63809b6189
3
+ metadata.gz: 1d513f31a000f2c127ea4c50ebe8dda95b11425f89aad9307c83726200388e88
4
+ data.tar.gz: 41ab2700090831c00c362d7490076593b21c9b5e263492ceb43340d008b1a844
5
5
  SHA512:
6
- metadata.gz: 3be1ac6bac4b2365341c9fdabb8bb0255a1be0d0250590ece10f325c0da032a044929930fb518f896563e27a5f4556be4f64b658f2d57188db35f89e324fac31
7
- data.tar.gz: 1389d15dabdee7b4681272affe38b42f01ec04f7bfb23e4d3bb07e5d494d36d41da1ab9e1609071df7390112f528e576ae132e1ab10b47b4f4eae735de8f3203
6
+ metadata.gz: ca535327c65c47e764f200132d7fa52e5f194b8557009cffb031cc29a56b2fc2f6a4a5ba3afe85a789809fab7862358079aee84caa46ddc0c83c86dcd32430bf
7
+ data.tar.gz: b9a4110ef2b4df89b8ddcc55d24dea901688f6ad66b6f1a1a98a8cc88b2217f935698ab05f5c264c8b541211db7d6401781650c9148449c2ee679adac6fef746
data/bin/h-jumplist CHANGED
@@ -66,18 +66,42 @@ end
66
66
 
67
67
  Hiiro.run(*ARGV) do
68
68
  add_subcmd(:setup) do
69
- puts <<~SETUP
70
- # Add the following to your tmux.conf:
69
+ conf_dir = File.join(Dir.home, '.config', 'tmux')
70
+ conf_file = File.join(conf_dir, 'h-jumplist.tmux.conf')
71
+ tmux_conf = File.join(Dir.home, '.tmux.conf')
72
+ source_line = "source-file #{conf_file}"
71
73
 
74
+ FileUtils.mkdir_p(conf_dir)
75
+
76
+ jumplist_conf = <<~CONF
72
77
  # --- Jumplist hooks (record pane/window/session navigation) ---
73
78
  set-hook -g after-select-pane "run-shell -b 'h jumplist record'"
74
79
  set-hook -g after-select-window "run-shell -b 'h jumplist record'"
80
+ set-hook -g after-new-window "run-shell -b 'h jumplist record'"
81
+ set-hook -g after-split-window "run-shell -b 'h jumplist record'"
75
82
  set-hook -g client-session-changed "run-shell -b 'h jumplist record'"
76
83
 
77
84
  # --- Jumplist keybindings ---
78
85
  bind-key -r C-b run-shell "h jumplist back"
79
86
  bind-key -r C-f run-shell "h jumplist forward"
80
- SETUP
87
+ CONF
88
+
89
+ File.write(conf_file, jumplist_conf)
90
+ puts "Wrote #{conf_file}"
91
+
92
+ if File.exist?(tmux_conf)
93
+ existing = File.read(tmux_conf)
94
+ if existing.include?(source_line)
95
+ puts "#{tmux_conf} already sources #{conf_file}"
96
+ next
97
+ end
98
+ end
99
+
100
+ File.open(tmux_conf, 'a') do |f|
101
+ f.puts
102
+ f.puts source_line
103
+ end
104
+ puts "Added '#{source_line}' to #{tmux_conf}"
81
105
  end
82
106
 
83
107
  add_subcmd(:clear) do
data/lib/hiiro/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Hiiro
2
- VERSION = "0.1.142"
2
+ VERSION = "0.1.144"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hiiro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.142
4
+ version: 0.1.144
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota