splashrc 1.1.1 → 1.1.2

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 (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/splashrc +9 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 85b613ee7069a953e030253daf809cf783cc1176
4
- data.tar.gz: c84ba5d9423705212d3c004a7d2cfc77cf2985b1
3
+ metadata.gz: deeb97bdefc102ff804e8d91e712f1868932f2c1
4
+ data.tar.gz: ea3238fa8528ae79799a55d5c8ec42555942c4ed
5
5
  SHA512:
6
- metadata.gz: 69b09c0a4e59ce680772b40ed0362f47448666f608512ebbe10b9555948c9b8cf4a704c8ac91090c7567e16d0b22d45c184d0a54052cd920eb15bb6d3b1204d2
7
- data.tar.gz: 27ca781fc1f3d724c11d39ba779e8040b3b6f149e41175ddb7ad37f09336e4e4556cfe1ed55613e26fa5c72cd437fe0b7eae4c248abcfc6bfc59fbdcfd4d1c0b
6
+ metadata.gz: 2340837c78c71f88138944548d5e45da49414701f3f1ddd037ae22c6f04f1e817244dbca1fc61f84b95176f00cae778f3ef546c4b27bb1c6f1569ed52ff03207
7
+ data.tar.gz: '08058a15b936906cf78f0aa4f3758636d590f654783471ea8914f777dcddb9fe698ba0c8b5bb809708a5e8cd7dd878e15d3e39dce3a154546add9ec5a2672d9c'
data/bin/splashrc CHANGED
@@ -48,7 +48,12 @@ uptime=`uptime`.split("user")[0].split("up")[-1].split(",")[0].split(/\s+/)[1].g
48
48
  uptime.match(/^\d+h\s+\d+$/)&&uptime="0d #{uptime}m"
49
49
  uptime.match(/^\d+m$/)&&uptime="0d 0h #{uptime}"
50
50
 
51
- res = Open3.capture3("xrandr")
51
+ begin
52
+ res = Open3.capture3("xrandr")
53
+ rescue Errno::ENOENT
54
+ abort "Please install xrandr(probably located in xorg-xrandr)."
55
+ end
56
+
52
57
  if res[-1].to_s.split[-1].to_i!=0
53
58
  require 'io/console'
54
59
  res = IO.console.winsize.join("x")+"(chrs)"
@@ -59,6 +64,7 @@ else
59
64
  end
60
65
 
61
66
  irb_loc = (`which irb`.match(/^which:/).nil? ? `which irb`.chomp : "*r*NOT FOUND")
67
+ ruby_loc = (`which ruby`.match(/^which:/).nil? ? `which ruby`.chomp : "*r*NOT FOUND")
62
68
  cpu_name= File.read("/proc/cpuinfo").split("\n").select{|i|i.match(/^model\s+name\s+:\s+.+/)}[0].split(/\s*:\s*/)[-1]
63
69
  ram_info=`free -m`.split("\n")[1].split[1,2].reverse.join("MiB / ")+"MiB"
64
70
 
@@ -70,7 +76,7 @@ add = [
70
76
  "Locale:*w* #{ENV['LANG']}",
71
77
  "Time:*w* #{Time.now}",
72
78
  "Timezone:*w* #{Time.new.zone}",
73
- "Ruby:*w* #{ENV['_']}",
79
+ "Ruby:*w* #{ruby_loc}",
74
80
  "Ruby version:*w* #{RUBY_VERSION}",
75
81
  "Gems:*w* #{`gem list`.split("\n").length}",
76
82
  "Shell:*w* #{ENV['SHELL']}",
@@ -86,4 +92,4 @@ at_exit{puts "\e[0;39m"}
86
92
 
87
93
  puts
88
94
  puts $rc
89
- puts
95
+ puts
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: splashrc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - sesshomariu