Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ushis/clipboard into ushi…
Browse files Browse the repository at this point in the history
…s-master
  • Loading branch information
janlelis committed Apr 21, 2013
2 parents 63cf780 + 79ba30d commit c6de0dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/clipboard/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Clipboard::File
FILE = File.expand_path("~/.clipboard")

def copy(text)
File.open(FILE,'w'){|f| f.write(text) } rescue ''
File.open(FILE, 'w', 0600) { |f| f.write(text) } rescue ''
paste
end

Expand Down
4 changes: 2 additions & 2 deletions lib/clipboard/linux.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ module Clipboard::Linux
CLIPBOARDS = %w[clipboard primary secondary]

# check which backend to use
if !`which xclip`.empty?
if system('which xclip &>/dev/null')
WriteCommand = 'xclip'
ReadCommand = 'xclip -o'
Selection = proc{|x| "-selection #{x}"}
elsif !`which xsel`.empty?
elsif system('which xsel &>/dev/null')
WriteCommand = 'xsel'
ReadCommand = 'xsel -o'
Selection = {'clipboard' => '-b', 'primary' => '-p', 'secondary' => '-s'}
Expand Down

0 comments on commit c6de0dd

Please sign in to comment.