Sha256: 31c02adcb3e94d8c0c46cd397cd7767e6ef6d9559c8a55dcd21f6deaaef01805

Contents?: true

Size: 1.7 KB

Versions: 1

Compression:

Stored size: 1.7 KB

Contents

# -*- encoding: UTF-8 -*-

module CSD
  module Application
    module Minisip
      module Component
        module Gnome
          class << self
            
            DESKTOP_ENTRY = %{
[Desktop Entry]
Encoding=UTF-8
Name=MiniSIP Client
GenericName=Video conferencing client
Comment=Have a video conference in high-definition
Exec=minisip_gtkgui
Icon=minisip_gnome
Terminal=false
Type=Application
StartupNotify=true
Categories=Application;Internet;Network;Chat;AudioVideo}
            
            def compile
              UI.debug "#{self}.compile was called"
              return unless Gem::Platform.local.debian? # TODO: Actually, Ubuntu only, not Debian. But I'm not so sure.
              if Options.this_user
                # This command opens the bin directory in Debian/Ubuntu as to show where the executables are located in a single-user mode installation.
                UI.info "Revealing user-specific MiniSIP exectutables"
                Cmd.run "nautilus #{Path.build_bin}"
              else
                create_desktop_entry
              end
            end
            
            def create_desktop_entry
              UI.info "Installing Gnome menu item".green.bold
              Cmd.run("sudo cp #{Path.minisip_gnome_png} #{Path.minisip_gnome_pixmap}", :announce_pwd => false) unless Path.minisip_gnome_pixmap.file?
              Path.new_desktop_entry = Pathname.new File.join(Dir.mktmpdir, 'minisip.desktop')
              Cmd.touch_and_replace_content Path.new_desktop_entry, DESKTOP_ENTRY, :internal => true
              Cmd.run "sudo mv #{Path.new_desktop_entry} #{Path.minisip_desktop_entry}", :announce_pwd => false
            end
          
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
csd-0.1.10 lib/csd/application/minisip/component/gnome.rb