class Durt::UpworkTracker

Public Class Methods

close_edit_memo() click to toggle source
# File lib/durt/upwork_tracker.rb, line 27
def self.close_edit_memo
  `xdotool key ctrl+alt+t`
  `xdotool key super+7`
  sleep(1)
end
edit_memo(issue) click to toggle source
# File lib/durt/upwork_tracker.rb, line 15
def self.edit_memo(issue)
  `xdotool key ctrl+shift+BackSpace`

  `xdotool type '#{issue}'`
  sleep(0.5)

  `xdotool key Tab`
  `xdotool key Tab`
  `xdotool key Return`
  sleep(0.5)
end
enter(issue) click to toggle source
# File lib/durt/upwork_tracker.rb, line 33
def self.enter(issue)
  open_edit_memo
  edit_memo(issue)
  close_edit_memo

  stop
end
open_edit_memo() click to toggle source
# File lib/durt/upwork_tracker.rb, line 7
def self.open_edit_memo
  `xdotool key super+7`

  reset_workspace

  `xdotool key ctrl+alt+e`
end
reset_workspace() click to toggle source

private

# File lib/durt/upwork_tracker.rb, line 81
def self.reset_workspace
  # Ensure that the time tracking window moves to current workspace
  `xdotool key ctrl+alt+t`
  `xdotool key ctrl+alt+t`
  sleep(0.5)
end
start() click to toggle source
# File lib/durt/upwork_tracker.rb, line 41
def self.start
  `xdotool key ctrl+alt+0x005D`
end
stop() click to toggle source
# File lib/durt/upwork_tracker.rb, line 45
def self.stop
  `xdotool key ctrl+alt+0x005B`
end
switch_project(project) click to toggle source
# File lib/durt/upwork_tracker.rb, line 49
def self.switch_project(project)
  open_edit_memo

  `xdotool key Escape`
  sleep(0.5)

  toggle_fullscreen

  `xdotool mousemove --sync 400 50 click 1`
  sleep(0.5)

  `xdotool key Tab`
  sleep(0.5)

  `xdotool type #{project.name}`
  sleep(0.5)

  `xdotool mousemove --sync 400 150 click 1`
  sleep(0.5)

  toggle_fullscreen

  close_edit_memo
end
toggle_fullscreen() click to toggle source
# File lib/durt/upwork_tracker.rb, line 74
def self.toggle_fullscreen
  `xdotool key super+f`
  sleep(0.5)
end