Linux 一键静音脚本

2015-09-29 0 895
Linux 一键静音脚本
#!/usr/bin/env ruby
#alsactl -F init # if can't unmute

s = `amixer get Master`
val = s.scan(/Mono:\sPlayback\s(\d+)/)[0][0].to_i
val1 = 41

if val < val1
  `notify-send '<span color="yellow" size="60000">unmute </span>'`
  puts `amixer set Master #{val1} `
else
  puts `amixer set Master 1`
  `notify-send '<span color="yellow" size="60000">mute </span>'`
end

#if not File.exist? '/usr/local/sbin/m'
  #puts `ln -s #{Dir.pwd}/m.rb /usr/local/sbin/m`
#end

遇见资源网 ruby Linux 一键静音脚本 http://www.ox520.com/16500.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务