splashrc 1.1.2 → 1.1.3

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 +13 -10
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: deeb97bdefc102ff804e8d91e712f1868932f2c1
4
- data.tar.gz: ea3238fa8528ae79799a55d5c8ec42555942c4ed
3
+ metadata.gz: 3da73e14990d15dada1af3a193b9ed7c5f223e57
4
+ data.tar.gz: 7605743ebe9216567b6e93396edaa86d117806b2
5
5
  SHA512:
6
- metadata.gz: 2340837c78c71f88138944548d5e45da49414701f3f1ddd037ae22c6f04f1e817244dbca1fc61f84b95176f00cae778f3ef546c4b27bb1c6f1569ed52ff03207
7
- data.tar.gz: '08058a15b936906cf78f0aa4f3758636d590f654783471ea8914f777dcddb9fe698ba0c8b5bb809708a5e8cd7dd878e15d3e39dce3a154546add9ec5a2672d9c'
6
+ metadata.gz: 2eb6486ef0a0fca419bfcec81f0cd92f0c15487736a7e23b8518ded6e90b7247611a30189541bbda26e874ccd8c80c083f655a5cb708e807c84ba12e3184faa7
7
+ data.tar.gz: 62804f5d42b936a0df9f96937baa05dcc45eea2de21ce7aafb38c72b5553ca2e423247184e6e4858b4af2507185eb6a3f33deeb09dfa9e13014311dfeebec8ad
data/bin/splashrc CHANGED
@@ -51,18 +51,18 @@ uptime.match(/^\d+m$/)&&uptime="0d 0h #{uptime}"
51
51
  begin
52
52
  res = Open3.capture3("xrandr")
53
53
  rescue Errno::ENOENT
54
- abort "Please install xrandr(probably located in xorg-xrandr)."
55
- end
56
-
57
- if res[-1].to_s.split[-1].to_i!=0
58
- require 'io/console'
59
- res = IO.console.winsize.join("x")+"(chrs)"
54
+ res_determined = false
60
55
  else
61
- res[0,1].join.split("\n").select!{|i|i.match(/^Screen #{ENV['DISPLAY'].reverse}/)}
62
- res = res[0].split(/,\s+/).select!{|i|i.match(/current\s*\d+\s*x\s*\d+\s*/)}[0]
63
- res = res.split.drop(1).join+"(px)"
56
+ if res[-1].to_s.split[-1].to_i!=0
57
+ require 'io/console'
58
+ res = IO.console.winsize.join("x")+"(chrs)"
59
+ else
60
+ res[0,1].join.split("\n").select!{|i|i.match(/^Screen #{ENV['DISPLAY'].reverse}/)}
61
+ res = res[0].split(/,\s+/).select!{|i|i.match(/current\s*\d+\s*x\s*\d+\s*/)}[0]
62
+ res = res.split.drop(1).join+"(px)"
63
+ end
64
+ res_determined = true
64
65
  end
65
-
66
66
  irb_loc = (`which irb`.match(/^which:/).nil? ? `which irb`.chomp : "*r*NOT FOUND")
67
67
  ruby_loc = (`which ruby`.match(/^which:/).nil? ? `which ruby`.chomp : "*r*NOT FOUND")
68
68
  cpu_name= File.read("/proc/cpuinfo").split("\n").select{|i|i.match(/^model\s+name\s+:\s+.+/)}[0].split(/\s*:\s*/)[-1]
@@ -85,8 +85,11 @@ add = [
85
85
  "CPU:*w* #{cpu_name}",
86
86
  "RAM:*w* #{ram_info}",
87
87
  "",
88
+ "",
88
89
  ]
89
90
 
91
+ res_determined||add.delete_at(add.index(add.select{|i|i.match(/^Resolution:/)}[0]))
92
+
90
93
  $rc.each_with_index{ |i,ind| $rc[ind] = colors[ind].gsub("%s",$rc[ind]).gsub("|"," ").concat("\e[1;36m").concat(add[ind]).concat("\e[39m").gsub("*w*","\e[37m").gsub("*c*","\e[1;36m").gsub("*r*","\e[0;31m") }
91
94
  at_exit{puts "\e[0;39m"}
92
95
 
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.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - sesshomariu