Module: ClipboardManager

Defined in:
lib/clipboard_manager/config.rb,
lib/clipboard_manager/version.rb,
lib/clipboard_manager/clipboard_manager.rb

Defined Under Namespace

Classes: ClipboardManager

Constant Summary collapse

APPDIR =
File.dirname File.dirname __dir__
CONFIG =
{
  Help: help,

  TimeOut: 3,
  Sleep: 0.5,
  MaxHistory: 13,
  MaxString: 60,

  IsPwd: is_pwd,

  Working: "#{XDG['DATA']}/gtk3app/clipboardmanager/working.png",
  Ok:      "#{XDG['DATA']}/gtk3app/clipboardmanager/ok.png",
  Nope:    "#{XDG['DATA']}/gtk3app/clipboardmanager/nope.png",
  Ready:   "#{XDG['DATA']}/gtk3app/clipboardmanager/ready.png",
  Off:     "#{XDG['DATA']}/gtk3app/clipboardmanager/off.png",

  thing: {

    HelpFile: "https://github.com/carlosjhr64/clipboard_manager",
    : "#{XDG['DATA']}/gtk3app/clipboardmanager/logo.png",

    about_dialog: {
      set_program_name: 'Clipboard Manager',
      set_version: VERSION,
      set_copyright: '(c) 2014 CarlosJHR64',
      set_comments: 'A Ruby Gtk3App Clipboard Manager ',
      set_website: 'https://github.com/carlosjhr64/clipboard_manager',
      set_website_label: 'See it at GitHub!',
    },

    TOGGLE: ['Toggle On/Off'],
    toggle!: [:TOGGLE, 'activate'],

    window: {
      set_title: "Clipboard Manager",
      set_window_position: :center,
    },

    VBOX: [:vertical],
    vbox: h0,
    vbox!: [:VBOX, :vbox],

    ASK: ['Ask For Confirmation'],
    ask: h0,
    ask!: [:ASK, :ask],

    RUNNING: ['On/Off'],
    running: h0,
    running!: [:RUNNING, :running],

    TASKS: ['Tasks:'],
    tasks: h0,
    tasks!: [:TASKS, :tasks],

    HISTORY_BUTTON: [label: 'History'],
    history_button: h0,
    history_button!: [:HISTORY_BUTTON, :history_button],

    HISTORY_DIALOG: [],
    history_dialog: {},
    history_dialog!: [:HISTORY_DIALOG, :history_dialog],

    HISTORY_COMBO: [],
    history_combo: {},
    history_combo!: [:HISTORY_COMBO, :history_combo],
  },

  # Note that Ruby 2 hashes preserves order, and order here is important.
  tasks: {
    mplayer: [
      'https?://www\.youtube\.com/\S+',
      :system,
      "wget -O - $(youtube-dl -f 5/36/17/18 -g '$0') | mplayer -really-quiet -cache 8192 -cache-min 1 - &",
    ],
    firefox: ['^https?://www.amazon.com/', :firefox],
    espeak: ['.{80,}', :espeak],
  }
}
VERSION =
'0.0.0'

Class Method Summary collapse

Class Method Details

.optionsObject



7
8
9
# File 'lib/clipboard_manager/clipboard_manager.rb', line 7

def self.options
  @@options
end

.options=(opts) ⇒ Object



4
5
6
# File 'lib/clipboard_manager/clipboard_manager.rb', line 4

def self.options=(opts)
  @@options=opts
end

.run(program) ⇒ Object



11
12
13
# File 'lib/clipboard_manager/clipboard_manager.rb', line 11

def self.run(program)
  ClipboardManager.new(program)
end