Skip to content

Instantly share code, notes, and snippets.

@oriolrius
Last active July 18, 2018 05:48
Show Gist options
  • Select an option

  • Save oriolrius/e1f5f3f554277f8dfc0a2d95d48051ff to your computer and use it in GitHub Desktop.

Select an option

Save oriolrius/e1f5f3f554277f8dfc0a2d95d48051ff to your computer and use it in GitHub Desktop.

Revisions

  1. oriolrius revised this gist Jul 18, 2018. No changes.
  2. oriolrius created this gist Jul 18, 2018.
    33 changes: 33 additions & 0 deletions bash.ahk
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    #WinActivateForce
    #SingleInstance force

    runApp(exe) {
    IfWinExist, ahk_exe %exe%
    {
    IfWinActive
    {
    WinMinimize
    return
    }
    } else {
    Run, %exe%
    WinWait, ahk_exe %exe%,, 4
    }
    WinRestore
    WinActivate
    WinSet, Top
    SysGet, NumMon, MonitorCount
    if ( NumMon > 2 ) {
    WinMove,,, 1920, 0, 1850, 1080
    } else {
    WinMove,,, 0, 0, 1850, 1050
    }
    ; WinSet, Style, -0x200000; HSCROLL
    WinSet, Style, -0xC00000; WINDOW TITLE
    return
    }

    F1::
    runApp("c:\windows\system32\bash.exe")
    return