updated version (8.2.0.03)

release 8.2.0
This commit is contained in:
joten 2011-09-02 19:46:07 +02:00
parent aeaa677f95
commit c64ce96ec1
11 changed files with 579 additions and 465 deletions

View file

@ -15,19 +15,19 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @version 8.2.0.03 (27.07.2011)
* @version 8.2.0.03 (31.08.2011)
*/
Bar_init(m) {
Local appBarMsg, GuiN, h1, h2, i, text, trayWndId, w, wndId, wndTitle, wndWidth, x1, x2, y1, y2
Local appBarMsg, GuiN, h1, h2, i, text, titleWidth, trayWndId, w, wndId, wndTitle, wndWidth, x1, x2, y1, y2
If (SubStr(Config_barWidth, 0) = "%") {
StringTrimRight, Config_barWidth, Config_barWidth, 1
wndWidth := Monitor_#%m%_width * Config_barWidth / 100
StringTrimRight, wndWidth, Config_barWidth, 1
wndWidth := Monitor_#%m%_width * wndWidth / 100
} Else
wndWidth := Config_barWidth
Monitor_#%m%_barWidth := wndWidth
Bar_titleWidth := wndWidth
titleWidth := wndWidth
h1 := Bar_ctrlHeight
x1 := 0
x2 := wndWidth
@ -41,7 +41,7 @@ Bar_init(m) {
Gui, %GuiN%: Default
IfWinExist, %wndTitle%
Gui, Destroy
Gui, +LastFound -Caption +ToolWindow +AlwaysOnTop
Gui, +AlwaysOnTop -Caption +LabelBar_Gui +LastFound +ToolWindow
Gui, Color, %Config_normBgColor2%
Gui, Font, c%Config_normFgColor1% s%Config_fontSize%, %Config_fontName%
@ -50,12 +50,13 @@ Bar_init(m) {
i := A_Index
text := " " i " "
w := Bar_getTextWidth(text)
Gui, Add, Text, x%x1% y%y1% w%w% h%h1% BackgroundTrans vBar_#%m%_#%i%_view gBar_GuiClick,
If (w <= h1)
Gui, Add, Progress, x%x1% y%y1% w%w% h%h1% Vertical vBar_#%m%_#%i%_progress
Gui, Add, Progress, x%x1% y%y1% w%w% h%h1% Vertical vBar_#%m%_#%i%_tagged
Else
Gui, Add, Progress, x%x1% y%y1% w%w% h%h1% vBar_#%m%_#%i%_progress
Gui, Add, Text, x%x1% y%y2% w%w% h%h2% -Wrap Center BackgroundTrans vBar_#%m%_#%i% gBar_tagGuiClick, %text%
Bar_titleWidth -= w
Gui, Add, Progress, x%x1% y%y1% w%w% h%h1% vBar_#%m%_#%i%_tagged
Gui, Add, Text, x%x1% y%y2% w%w% h%h2% -Wrap Center BackgroundTrans vBar_#%m%_#%i%, %text%
titleWidth -= w
x1 += w
}
; layout
@ -63,8 +64,8 @@ Bar_init(m) {
text := " ??? "
w := Bar_getTextWidth(text)
Gui, Font, c%Config_normFgColor2%
Gui, Add, Text, x%x1% y%y2% w%w% h%h2% -Wrap Center vBar_#%m%_#%i% gBar_layoutGuiClick, %text%
Bar_titleWidth -= w
Gui, Add, Text, x%x1% y%y2% w%w% h%h2% -Wrap Center vBar_#%m%_#%i% gBar_GuiClick, %text%
titleWidth -= w
x1 += w
; The x-position and width of the sub-windows right of the window title are set from the right.
@ -75,12 +76,12 @@ Bar_init(m) {
Gui, -Disabled
w := Bar_getTextWidth(" ?? ")
x2 -= w
Bar_titleWidth -= w
titleWidth -= w
Gui, Add, Text, x%x2% y%y2% w%w% h%h2% Center gBar_toggleCommandGui vBar_#%m%_#%i%, #!
} Else If (i = Config_viewCount + 5) And Config_readinTime { ; time
w := Bar_getTextWidth(" ??:?? ")
x2 -= w
Bar_titleWidth -= w
titleWidth -= w
If Config_readinAny() Or Config_readinBat {
Gui, Font, c%Config_normFgColor1%
Gui, Add, Text, x%x2% y%y1% w%w% h%h1% -Background,
@ -88,45 +89,48 @@ Bar_init(m) {
Gui, Add, Text, x%x2% y%y2% w%w% h%h2% BackgroundTrans Center vBar_#%m%_#%i%, ??:??
} Else If (i = Config_viewCount + 4) And Config_readinAny() { ; any
text := Config_readinAny()
w += Bar_getTextWidth(text)
w := Bar_getTextWidth(text)
x2 -= w
Bar_titleWidth -= w
titleWidth -= w
Gui, Font, c%Config_normFgColor2%
Gui, Add, Text, x%x2% y%y2% w%w% h%h2% Center vBar_#%m%_#%i%, %text%
} Else If (i = Config_viewCount + 3) And Config_readinBat { ; battery level
w := Bar_getTextWidth(" BAT: ???% ")
x2 -= w
Bar_titleWidth -= w
Gui, Add, Progress, x%x2% y%y1% w%w% h%h1% Background%Config_normBgColor2% c%Config_normFgColor3% vBar_#%m%_#%i%_progress
titleWidth -= w
Gui, Add, Progress, x%x2% y%y1% w%w% h%h1% Background%Config_normBgColor2% c%Config_normFgColor3% vBar_#%m%_#%i%_tagged
Gui, Font, c%Config_normFgColor2%
Gui, Add, Text, x%x2% y%y2% w%w% h%h2% BackgroundTrans Center vBar_#%m%_#%i%, BAT: ???`%
}
}
; window title (remaining space)
Gui, Add, Text, x%x1% y%y1% w%Bar_titleWidth% h%h1% -Background,
Gui, Add, Text, x%x1% y%y1% w%titleWidth% h%h1% -Background,
If Not Config_singleRowBar {
Bar_titleWidth := wndWidth
titleWidth := wndWidth
x1 := 0
y1 += h1
y2 += h1
}
i := Config_viewCount + 2
Gui, Font, c%Config_normFgColor1%
Gui, Add, Text, x%x1% y%y1% w%Bar_titleWidth% h%h1% -Background,
Gui, Add, Text, x%x1% y%y2% w%Bar_titleWidth% h%h2% BackgroundTrans Center vBar_#%m%_#%i%,
Gui, Add, Text, x%x1% y%y1% w%titleWidth% h%h1% -Background,
Gui, Add, Text, x%x1% y%y2% w%titleWidth% h%h2% BackgroundTrans Center vBar_#%m%_#%i%,
If (Config_horizontalBarPos = "left")
x1 := Monitor_#%m%_x
x1 := 0
Else If (Config_horizontalBarPos = "right")
x1 := Monitor_#%m%_x + Monitor_#%m%_width - wndWidth
x1 := Monitor_#%m%_width - wndWidth
Else If (Config_horizontalBarPos = "center")
x1 := Monitor_#%m%_x + (Monitor_#%m%_width - wndWidth) / 2
x1 := (Monitor_#%m%_width - wndWidth) / 2
Else If (Config_horizontalBarPos => 0)
x1 := Monitor_#%m%_x + Config_horizontalBarPos
x1 := Config_horizontalBarPos
Else If (Config_horizontalBarPos < 0)
x1 := Monitor_#%m%_x + Monitor_#%m%_width - wndWidth + Config_horizontalBarPos
x1 := Monitor_#%m%_width - wndWidth + Config_horizontalBarPos
If Not (Config_verticalBarPos = "tray" And m = Manager_taskBarMonitor)
x1 += Monitor_#%m%_x
Bar_#%m%_titleWidth := titleWidth
Monitor_#%m%_barX := x1
y1 := Monitor_#%m%_barY
@ -135,7 +139,7 @@ Bar_init(m) {
Else
Gui, Show, +NoActivate Hide x%x1% y%y1% w%wndWidth% h%Bar_height%, %wndTitle%
wndId := WinExist(wndTitle)
If (Config_verticalBarPos = "tray") {
If (Config_verticalBarPos = "tray" And m = Manager_taskBarMonitor) {
trayWndId := WinExist("ahk_class Shell_TrayWnd")
DllCall("SetParent", "UInt", wndId, "UInt", trayWndId)
} Else {
@ -454,21 +458,30 @@ Bar_getTextWidth(x, reverse=False) {
Return, textWidth
}
Bar_layoutGuiClick:
Bar_GuiClick:
Manager_winActivate(Bar_aWndId)
If (A_GuiEvent = "Normal") {
If Not (SubStr(A_GuiControl, 5, InStr(A_GuiControl, "][")-5) = Manager_aMonitor)
Manager_activateMonitor(SubStr(A_GuiControl, 5, InStr(A_GuiControl, "][")-5) - Manager_aMonitor)
View_setLayout(-1)
If Not (SubStr(A_GuiControl, 6, InStr(A_GuiControl, "_#", False, 0) - 6) = Manager_aMonitor)
Manager_activateMonitor(SubStr(A_GuiControl, 6, InStr(A_GuiControl, "_#", False, 0) - 6) - Manager_aMonitor)
If (SubStr(A_GuiControl, -2) = "_#6")
View_setLayout(-1)
Else If (SubStr(A_GuiControl, -4) = "_view")
Monitor_activateView(SubStr(A_GuiControl, InStr(A_GuiControl, "_#", False, 0) + 2, 1))
}
Return
Bar_layoutGuiContextMenu:
Bar_GuiContextMenu:
Manager_winActivate(Bar_aWndId)
If (A_GuiEvent = "RightClick") {
If Not (SubStr(A_GuiControl, 5, InStr(A_GuiControl, "][")-5) = Manager_aMonitor)
Manager_activateMonitor(SubStr(A_GuiControl, 5, InStr(A_GuiControl, "][")-5) - Manager_aMonitor)
View_setLayout(">")
If (SubStr(A_GuiControl, -2) = "_#6") {
If Not (SubStr(A_GuiControl, 6, InStr(A_GuiControl, "_#", False, 0) - 6) = Manager_aMonitor)
Manager_activateMonitor(SubStr(A_GuiControl, 6, InStr(A_GuiControl, "_#", False, 0) - 6) - Manager_aMonitor)
View_setLayout(">")
} Else If (SubStr(A_GuiControl, -4) = "_view") {
If Not (SubStr(A_GuiControl, 6, InStr(A_GuiControl, "_#", False, 0) - 6) = Manager_aMonitor)
Manager_setWindowMonitor(SubStr(A_GuiControl, 6, InStr(A_GuiControl, "_#", False, 0) - 6) - Manager_aMonitor)
Monitor_setWindowTag(SubStr(A_GuiControl, InStr(A_GuiControl, "_#", False, 0) + 2, 1))
}
}
Return
@ -486,28 +499,10 @@ Bar_move(m) {
WinMove, %wndTitle%, , %x%, %y%
}
Bar_tagGuiClick:
Manager_winActivate(Bar_aWndId)
If (A_GuiEvent = "Normal") {
If Not (SubStr(A_GuiControl, 5, InStr(A_GuiControl, "][")-5) = Manager_aMonitor)
Manager_activateMonitor(SubStr(A_GuiControl, 5, InStr(A_GuiControl, "][")-5) - Manager_aMonitor)
Monitor_activateView(SubStr(A_GuiControl, InStr(A_GuiControl, "][")+2, 1))
}
Return
Bar_tagGuiContextMenu:
Manager_winActivate(Bar_aWndId)
If (A_GuiEvent = "RightClick") {
If Not (SubStr(A_GuiControl, 5, InStr(A_GuiControl, "][")-5) = Manager_aMonitor)
Manager_setWindowMonitor(SubStr(A_GuiControl, 5, InStr(A_GuiControl, "][")-5) - Manager_aMonitor)
Monitor_setWindowTag(SubStr(A_GuiControl, InStr(A_GuiControl, "][")+2, 1))
}
Return
Bar_toggleCommandGui:
If Not Bar_cmdGuiIsVisible
If Not (SubStr(A_GuiControl, 5, InStr(A_GuiControl, "][")-5) = Manager_aMonitor)
Manager_activateMonitor(SubStr(A_GuiControl, 5, InStr(A_GuiControl, "][")-5) - Manager_aMonitor)
If Not (SubStr(A_GuiControl, 6, InStr(A_GuiControl, "_#", False, 0) - 6) = Manager_aMonitor)
Manager_activateMonitor(SubStr(A_GuiControl, 6, InStr(A_GuiControl, "_#", False, 0) - 6) - Manager_aMonitor)
Bar_toggleCommandGui()
Return
@ -522,10 +517,10 @@ Bar_toggleCommandGui() {
} Else {
Bar_cmdGuiIsVisible := True
x := Monitor_#%Manager_aMonitor%_barX + Monitor_#%Manager_aMonitor%_barWidth - Bar_#0_#0W
If (Config_verticalBarPos = "top")
If (Config_verticalBarPos = "top") Or (Config_verticalBarPos = "tray" And Not Manager_aMonitor = Manager_taskBarMonitor)
y := Monitor_#%Manager_aMonitor%_y
Else
y := Monitor_#%Manager_aMonitor%_barY + Bar_#0_#0H
y := Monitor_#%Manager_aMonitor%_y + Monitor_#%Manager_aMonitor%_height - Bar_#0_#0H
Gui, Show
WinMove, bug.n_BAR_0, , %x%, %y%
WinGet, wndId, ID, bug.n_BAR_0
@ -566,16 +561,16 @@ Bar_updateStatus() {
b3 := SubStr(" " b1, -2)
i := Config_viewCount + 3
If (b1 < 10) And (b2 = "off") { ; change the color, if the battery level is below 10%
GuiControl, +Background%Config_normBgColor4% +c%Config_normBgColor2%, Bar_#%m%_#%i%_progress
GuiControl, +Background%Config_normBgColor4% +c%Config_normBgColor2%, Bar_#%m%_#%i%_tagged
GuiControl, +c%Config_selFgColor6%, Bar_#%m%_#%i%
} Else If (b2 = "off") { ; change the color, if the pc is not plugged in
GuiControl, +Background%Config_normBgColor2% +c%Config_normFgColor5%, Bar_#%m%_#%i%_progress
GuiControl, +Background%Config_normBgColor2% +c%Config_normFgColor5%, Bar_#%m%_#%i%_tagged
GuiControl, +c%Config_normFgColor4%, Bar_#%m%_#%i%
} Else {
GuiControl, +Background%Config_normBgColor3% +c%Config_normFgColor3%, Bar_#%m%_#%i%_progress
GuiControl, +Background%Config_normBgColor3% +c%Config_normFgColor3%, Bar_#%m%_#%i%_tagged
GuiControl, +c%Config_normFgColor2%, Bar_#%m%_#%i%
}
GuiControl, , Bar_#%m%_#%i%_progress, %b3%
GuiControl, , Bar_#%m%_#%i%_tagged, %b3%
GuiControl, , Bar_#%m%_#%i%, % " BAT: " b3 "% "
}
anyText := Config_readinAny()
@ -583,7 +578,7 @@ Bar_updateStatus() {
i := Config_viewCount + 4
GuiControlGet, anyContent, , Bar_#%m%_#%i%
If Not (anyText = anyContent)
GuiControl, Bar_#%m%_#%i%, % anyText
GuiControl, , Bar_#%m%_#%i%, % anyText
}
If Config_readinTime {
i := Config_viewCount + 5
@ -592,21 +587,25 @@ Bar_updateStatus() {
}
}
Bar_updateTitle() {
Bar_updateTitle(debugMsg = "") {
Local aWndId, aWndTitle, content, GuiN, i, title
WinGet, aWndId, ID, A
WinGetTitle, aWndTitle, ahk_id %aWndId%
If InStr(Bar_hideTitleWndIds, aWndId . ";")
aWndTitle := ""
If Manager_#%aWndId%_isFloating
aWndTitle := "~ " aWndTitle
If (Manager_monitorCount > 1)
aWndTitle := "[" Manager_aMonitor "] " aWndTitle
If debugMsg
aWndTitle := debugMsg
Else {
WinGet, aWndId, ID, A
WinGetTitle, aWndTitle, ahk_id %aWndId%
If InStr(Bar_hideTitleWndIds, aWndId ";") Or (aWndTitle = "bug.n_BAR_0")
aWndTitle := ""
If Manager_#%aWndId%_isFloating
aWndTitle := "~ " aWndTitle
If (Manager_monitorCount > 1)
aWndTitle := "[" Manager_aMonitor "] " aWndTitle
}
title := " " . aWndTitle . " "
If (Bar_getTextWidth(title) > Bar_titleWidth) { ; shorten the window title if its length exceeds the width of the bar
i := Bar_getTextWidth(Bar_titleWidth, True) - 6
If (Bar_getTextWidth(title) > Bar_#%Manager_aMonitor%_titleWidth) { ; shorten the window title if its length exceeds the width of the bar
i := Bar_getTextWidth(Bar_#%Manager_aMonitor%_titleWidth, True) - 6
StringLeft, title, aWndTitle, i
title := " " . title . " ... "
}
@ -615,11 +614,11 @@ Bar_updateTitle() {
Loop, % Manager_monitorCount {
GuiN := (A_Index - 1) + 1
Gui, %GuiN%: Default
GuiControlGet, content, , Bar_#%A_Index%_#%i%
If (A_Index = Manager_aMonitor) {
GuiControlGet, content, , Bar_#%A_Index%_#%i%
If Not (title = content)
If Not (content = title)
GuiControl, , Bar_#%A_Index%_#%i%, % title
} Else
} Else If Not (content = "")
GuiControl, , Bar_#%A_Index%_#%i%,
}
Bar_aWndId := aWndId
@ -637,16 +636,16 @@ Bar_updateView(m, v) {
StringSplit, wndId, wndIds, `;
If (A_Index = v)
If (v = Monitor_#%m%_aView_#1) {
GuiControl, +Background%Config_selBgColor1% +c%Config_selFgColor2%, Bar_#%m%_#%v%_progress
GuiControl, +Background%Config_selBgColor1% +c%Config_selFgColor2%, Bar_#%m%_#%v%_tagged
GuiControl, +c%Config_selFgColor1%, Bar_#%m%_#%v%
} Else If wndId0 {
GuiControl, +Background%Config_normBgColor5% +c%Config_normFgColor8%, Bar_#%m%_#%v%_progress
GuiControl, +Background%Config_normBgColor5% +c%Config_normFgColor8%, Bar_#%m%_#%v%_tagged
GuiControl, +c%Config_normFgColor7%, Bar_#%m%_#%v%
} Else {
GuiControl, +Background%Config_normBgColor1% +c%Config_normFgColor8%, Bar_#%m%_#%v%_progress
GuiControl, +Background%Config_normBgColor1% +c%Config_normFgColor8%, Bar_#%m%_#%v%_tagged
GuiControl, +c%Config_normFgColor1%, Bar_#%m%_#%v%
}
GuiControl, , Bar_#%m%_#%A_Index%_progress, % wndId0 / managedWndId0 * 100
GuiControl, , Bar_#%m%_#%A_Index%_tagged, % wndId0 / managedWndId0 * 100
GuiControl, , Bar_#%m%_#%A_Index%, %A_Index%
}
}

View file

@ -15,11 +15,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @version 8.2.0.03 (27.07.2011)
* @version 8.2.0.03 (02.09.2011)
*/
Config_init() {
Local i, key, layout0, layout1, layout2, layout_#1, layout_#2, layout_#3
Local i, key, layout0, layout1, layout2
; status bar
Config_showBar := True ; If false, the bar is hidden. It can be made visible or hidden by hotkey (see below).
@ -45,56 +45,52 @@ Config_init() {
; Config_borderWidth, Config_borderPadding and Config_selBorderColor are especially usefull, if you are not allowed to set the design in the system settings.
; window arrangement
Config_viewCount := 9 ; The total number of views. This has effects on the displayed groups in the bar, and should not be exceeded in the hotkeys below.
layout_#1 := "[]=;tile" ; The layout symbol and arrange function (the first entry is set as the default layout, no layout function means floating behavior)
layout_#2 := "[M];monocle"
layout_#3 := "><>;"
Config_layout_#1 := "[]=;tile" ; The layout symbol and arrange function (the first entry is set as the default layout, no layout function means floating behavior)
Config_layout_#2 := "[M];monocle"
Config_layout_#3 := "><>;"
Config_layoutCount := 3 ; Total number of layouts defined above.
Config_layoutAxis_#1 := 1 ; The layout axis: 1 = x, 2 = y; negative values mirror the layout, setting the master area to the right / bottom instead of left / top.
Config_layoutAxis_#2 := 2 ; The master axis: 1 = x (from left to right), 2 = y (from top to bottom), 3 = z (monocle).
Config_layoutAxis_#3 := 2 ; The stack axis: 1 = x (from left to right), 2 = y (from top to bottom), 3 = z (monocle).
Config_layoutMFactor := 0.6 ; The factor for the size of the master area, which is multiplied by the monitor size.
Config_monitorFollowsMouse := False ; If true, the active monitor is determined by the position of the mouse pointer, if a window is opened; therefor the newly opened window will be moved there by default.
Config_mouseFollowsFocus := True ; If true, the mouse pointer is set over the focused window, if a window is activated by bug.n.
Config_shellMsgDelay := 350 ; The time bug.n waits after a shell message (a window is opened, closed or the focus has been changed); if there are any problems recognizing, when windows are opened or closed, try to increase this number.
Config_viewFollowsTagged := False ; If true, the view is set to, if a window is tagged with a single tag.
Config_syncMonitorViews := 0 ; The number of monitors (2 or more), for which views should be activated, when using the accordant hotkey. If set to 1, the views are actiated for all monitors. If set to 0, views are activated independently (only on the active monitor).
Config_viewFollowsTagged := False ; If true and a window is tagged with a single tag, the view is correspondingly set to the tag.
; Config_rules_#i := "<class (regular expression string)>;<title (regular expression string)>;<window style (hexadecimal number or blank)>;<is managed (1 = True or 0 = False)>;<monitor (0 <= integer <= total number of monitors, 0 means the currently active monitor)>;<tags (binary mask as integer >= 0, e. g. 17 for 1 and 5, 0 means the currently active tag)>;<is floating (1 = True or 0 = False)>;<is decorated (1 = True or 0 = False)>;<hide title (1 = True or 0 = False)>" (";" is not allowed as a character)
Config_rules_#1 := ".*;.*;;1;0;0;0;0;0" ; At first you may set a default rule (.*;.*;) for a default monitor, view and / or showing window title bars.
Config_rules_#2 := ".*;.*;0x80000000;0;0;0;1;1;1" ; Pop-up windows (style WS_POPUP=0x80000000) will not be managed, are floating and the titles are hidden.
Config_rules_#3 := "SWT_Window0;.*;;1;0;0;0;0;0" ; Windows created by Java (SWT) e. g. Eclipse have the style WS_POPUP, but should excluded from the above rule.
Config_rules_#4 := "Xming;.*;;1;0;0;0;0;0" ; Xming windows have the style WS_POPUP, but should be excluded from the above rule.
Config_rules_#5 := "_sp;_sp;;1;0;0;1;0;1"
Config_rules_#6 := "MozillaDialogClass;.*;;1;0;0;1;1;0"
Config_rules_#7 := "MsiDialog(No)?CloseClass;.*;;1;0;0;1;1;0"
Config_rules_#8 := "gdkWindowToplevel;GIMP-Start;;1;0;0;1;1;0"
Config_rules_#9 := "gdkWindowToplevel;GNU Image Manipulation Program;;1;0;0;1;1;0"
Config_rules_#10 := "gdkWindowToplevel;Werkzeugkasten;;1;0;0;1;1;0"
Config_rules_#11 := "gdkWindowToplevel;Ebenen, .* - Pinsel, Muster, .*;;1;0;0;1;1;0"
Config_rules_#12 := "gdkWindowToplevel;Toolbox;;1;0;0;1;1;0"
Config_rules_#13 := "gdkWindowToplevel;Layers, Channels, Paths, .*;;1;0;0;1;1;0"
Config_rules_#14 := "CalcFrame;.*;;1;0;0;1;1;0"
Config_rulesCount := 14 ; This variable has to be set to the total number of active rules above.
; Config_rule_#i := "<class (regular expression string)>;<title (regular expression string)>;<window style (hexadecimal number or blank)>;
; <is managed (1 = True or 0 = False)>;
; <monitor (0 <= integer <= total number of monitors, 0 means the currently active monitor)>;
; <tags (binary mask as integer >= 0, e. g. 17 for 1 and 5, 0 means the currently active tag)>;
; <is floating (1 = True or 0 = False)>;<is decorated (1 = True or 0 = False)>;<hide title (1 = True or 0 = False)>"
; (";" is not allowed as a character)
Config_rule_#1 := ".*;.*;;1;0;0;0;0;0" ; At first you may set a default rule (.*;.*;) for a default monitor, view and / or showing window title bars.
Config_rule_#2 := ".*;.*;0x80000000;0;0;0;1;1;1" ; Pop-up windows (style WS_POPUP=0x80000000) will not be managed, are floating and the titles are hidden.
Config_rule_#3 := "SWT_Window0;.*;;1;0;0;0;0;0" ; Windows created by Java (SWT) e. g. Eclipse have the style WS_POPUP, but should excluded from the above rule.
Config_rule_#4 := "Xming;.*;;1;0;0;0;0;0" ; Xming windows have the style WS_POPUP, but should be excluded from the above rule.
Config_rule_#5 := "MsiDialog(No)?CloseClass;.*;;1;0;0;1;1;0"
Config_rule_#6 := "AdobeFlashPlayerInstaller;.*;;1;0;0;1;0;1"
Config_rule_#7 := "CalcFrame;.*;;1;0;0;1;1;0"
Config_rule_#8 := "_sp;_sp;;1;0;0;1;0;1"
Config_rule_#9 := "MozillaDialogClass;.*;;1;0;0;1;1;0"
Config_rule_#10 := "gdkWindowToplevel;GIMP-Start;;1;0;0;1;1;0"
Config_rule_#11 := "gdkWindowToplevel;GNU Image Manipulation Program;;1;0;0;1;1;0"
Config_rule_#12 := "gdkWindowToplevel;Werkzeugkasten;;1;0;0;1;1;0"
Config_rule_#13 := "gdkWindowToplevel;Ebenen, .* - Pinsel, Muster, .*;;1;0;0;1;1;0"
Config_rule_#14 := "gdkWindowToplevel;Toolbox;;1;0;0;1;1;0"
Config_rule_#15 := "gdkWindowToplevel;Layers, Channels, Paths, .*;;1;0;0;1;1;0"
Config_ruleCount := 15 ; This variable has to be set to the total number of active rules above.
; session management
Config_autoSaveSession := False ; Automatically save the current state of monitors, views, layouts (active view, layout, axes, mfact and msplit) to te session file (set below) when quitting bug.n.
If Not Config_sessionFilePath ; The file path, to which the session is saved. This target directory must be writable by the user (%A_ScriptDir% is the diretory, in which "Main.ahk" or the executable of bug.n is saved).
Config_sessionFilePath := A_ScriptDir "\Session.ini"
; configuration management
Config_autoSaveSession := False ; Automatically save the current state of monitors, views, layouts (active view, layout, axes, mfact and msplit) to the configuration file (set below) when quitting bug.n.
If Not Config_filePath ; The file path, to which the configuration and session is saved. This target directory must be writable by the user (%A_ScriptDir% is the diretory, in which "Main.ahk" or the executable of bug.n is saved).
Config_filePath := A_ScriptDir "\Config.ini"
Session_restore("Config")
Config_restore("Config")
Config_getSystemSettings()
Config_initColors()
Loop, % Config_hotkeyCount {
i := InStr(Config_hotkey_#%A_Index%, "::")
Config_hotkey_#%A_index%_key := SubStr(Config_hotkey_#%A_Index%, 1, i - 1)
Config_hotkey_#%A_index%_command := SubStr(Config_hotkey_#%A_Index%, i + 2)
key := Config_hotkey_#%A_index%_key
If Not Config_hotkey_#%A_index%_command
Hotkey, %key%, Off
Else
Hotkey, %key%, Config_hotkeyLabel
}
Loop, % Config_layoutCount {
StringSplit, layout, layout_#%A_Index%, `;
StringSplit, layout, Config_layout_#%A_Index%, `;
Config_layoutFunction_#%A_Index% := layout2
Config_layoutSymbol_#%A_Index% := layout1
}
@ -233,6 +229,8 @@ Config_redirectHotkey(key) {
Run, %parameters%
} Else If (type = "Send ")
Send % SubStr(Config_hotkey_#%A_index%_command, 6)
Else If (type = "Reloa")
Reload
Else {
i := InStr(Config_hotkey_#%A_index%_command, "(")
j := InStr(Config_hotkey_#%A_index%_command, ")", False, i)
@ -252,13 +250,100 @@ Config_redirectHotkey(key) {
}
}
Config_restore(section, m = 0) {
Local cmd, i, key, type, val, var
If FileExist(Config_filePath) {
If (section = "Config") {
Loop, READ, %Config_filePath%
If (SubStr(A_LoopReadLine, 1, 7) = "Config_") {
i := InStr(A_LoopReadLine, "=")
var := SubStr(A_LoopReadLine, 1, i - 1)
val := SubStr(A_LoopReadLine, i + 1)
type := SubStr(var, 1, 13)
If (type = "Config_hotkey") {
i := InStr(val, "::")
key := SubStr(val, 1, i - 1)
cmd := SubStr(val, i + 2)
If Not cmd
Hotkey, %key%, Off
Else {
Config_hotkeyCount += 1
Config_hotkey_#%Config_hotkeyCount%_key := key
Config_hotkey_#%Config_hotkeyCount%_command := cmd
Hotkey, %key%, Config_hotkeyLabel
}
} Else If (type = "Config_rule") {
i := 0
If InStr(var, "Config_rule_#")
i := SubStr(var, 14)
If (i = 0 Or i > Config_ruleCount) {
Config_ruleCount += 1
i := Config_ruleCount
}
var := "Config_rule_#" i
}
%var% := val
}
} Else If (section = "Monitor") {
Loop, READ, %Config_filePath%
If (SubStr(A_LoopReadLine, 1, 10 + StrLen(m)) = "Monitor_#" m "_" Or SubStr(A_LoopReadLine, 1, 8 + StrLen(m)) = "View_#" m "_#") {
i := InStr(A_LoopReadLine, "=")
var := SubStr(A_LoopReadLine, 1, i - 1)
val := SubStr(A_LoopReadLine, i + 1)
%var% := val
}
}
}
}
Config_saveSession() {
Local m, text
text := "; bug.n - tiling window management`n; @version " VERSION " (" A_DD "." A_MM "." A_YYYY ")`n`n"
If FileExist(Config_filePath) {
Loop, READ, %Config_filePath%
If (SubStr(A_LoopReadLine, 1, 7) = "Config_")
text .= A_LoopReadLine "`n"
text .= "`n"
}
FileDelete, %Config_filePath%
Loop, % Manager_monitorCount {
m := A_Index
If Not (Monitor_#%m%_aView_#1 = 1)
text .= "Monitor_#" m "_aView_#1=" Monitor_#%m%_aView_#1 "`n"
If Not (Monitor_#%m%_aView_#2 = 1)
text .= "Monitor_#" m "_aView_#2=" Monitor_#%m%_aView_#2 "`n"
If Not (Monitor_#%m%_showBar = Config_showBar)
text .= "Monitor_#" m "_showBar=" Monitor_#%m%_showBar "`n"
Loop, % Config_viewCount {
If Not (View_#%m%_#%A_Index%_layout_#1 = 1)
text .= "View_#" m "_#" A_Index "_layout_#1=" View_#%m%_#%A_Index%_layout_#1 "`n"
If Not (View_#%m%_#%A_Index%_layout_#2 = 1)
text .= "View_#" m "_#" A_Index "_layout_#2=" View_#%m%_#%A_Index%_layout_#2 "`n"
If Not (View_#%m%_#%A_Index%_layoutAxis_#1 = Config_layoutAxis_#1)
text .= "View_#" m "_#" A_Index "_layoutAxis_#1=" View_#%m%_#%A_Index%_layoutAxis_#1 "`n"
If Not (View_#%m%_#%A_Index%_layoutAxis_#2 = Config_layoutAxis_#2)
text .= "View_#" m "_#" A_Index "_layoutAxis_#2=" View_#%m%_#%A_Index%_layoutAxis_#2 "`n"
If Not (View_#%m%_#%A_Index%_layoutAxis_#3 = Config_layoutAxis_#3)
text .= "View_#" m "_#" A_Index "_layoutAxis_#3=" View_#%m%_#%A_Index%_layoutAxis_#3 "`n"
If Not (View_#%m%_#%A_Index%_layoutMFact = Config_layoutMFactor)
text .= "View_#" m "_#" A_Index "_layoutMFact=" View_#%m%_#%A_Index%_layoutMFact "`n"
If Not (View_#%m%_#%A_Index%_layoutMSplit = 1)
text .= "View_#" m "_#" A_Index "_layoutMSplit=" View_#%m%_#%A_Index%_layoutMSplit "`n"
}
}
FileAppend, %text%, %Config_filePath%
}
/**
* key definitions
*
* format: <modifier><key>::<function>(<argument>)
* modifier: ! = Alt (Mod1Mask), ^ = Ctrl (ControlMask), + = Shift (ShiftMask), # = LWin (Mod4Mask)
*/
#Down::View_activateWindow(+1) ; Activate the next window in the active view.
#Up::View_activateWindow(-1) ; Activate the previous window in the active view.
#+Down::View_shuffleWindow(+1) ; Move the active window to the next position in the window list of the view.
@ -326,7 +411,6 @@ Config_redirectHotkey(key) {
#+Space::Monitor_toggleBar() ; Hide / Show the bar (bug.n status bar) on the active monitor.
#Space::Monitor_toggleTaskBar() ; Hide / Show the task bar.
#y::Bar_toggleCommandGui() ; Open the command GUI for executing programmes or bug.n functions.
#^e::Run, edit, %Config_sessionFilePath% ; Open the session file in the standard text editor.
#^s::Session_save() ; Save the current state of monitors, views, layouts.
#^r::Reload ; For resetting the confguration, if running bug.n as an Autohotkey script.
#^e::Run, edit %Config_filePath% ; Open the configuration file in the standard text editor.
#^s::Config_saveSession() ; Save the current state of monitors, views, layouts to the configuration file.
#^q::ExitApp ; Quit bug.n, restore the default Windows UI and show all windows.

View file

@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @version 8.2.0.01 (16.02.2011)
* @version 8.2.0.03 (21.08.2011)
*/
NAME := "bug.n"
@ -33,7 +33,7 @@ SetWinDelay, 10
; pseudo main function
If 0 = 1
Config_sessionFilePath = %1%
Config_filePath = %1%
Config_init()
Menu, Tray, Tip, %NAME% %VERSION%
@ -53,7 +53,7 @@ Return ; end of the auto-execute section
*/
Main_cleanup: ; The labels with "ExitApp" or "Return" at the end and hotkeys have to be after the auto-execute section.
If Config_autoSaveSession
Session_save()
Config_saveSession()
Manager_cleanup()
ExitApp
@ -73,5 +73,4 @@ Return
#Include Config.ahk
#Include Manager.ahk
#Include Monitor.ahk
#Include Session.ahk
#Include View.ahk

View file

@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @version 8.2.0.03 (27.07.2011)
* @version 8.2.0.03 (02.09.2011)
*/
Manager_init() {
@ -71,15 +71,18 @@ Manager_init() {
}
Manager_activateMonitor(d) {
Local aView, aWndClass, aWndId, v, wndId
Local aView, aWndClass, aWndHeight, aWndId, aWndWidth, aWndX, aWndY, v, wndId
If (Manager_monitorCount > 1) {
aView := Monitor_#%Manager_aMonitor%_aView_#1
WinGet, aWndId, ID, A
If WinExist("ahk_id" aWndId) {
WinGetClass, aWndClass, ahk_id %aWndId%
If Not (aWndClass = "Progman") And Not (aWndClass = "AutoHotkeyGui") And Not (aWndClass = "DesktopBackgroundClass")
View_#%Manager_aMonitor%_#%aView%_aWndId := aWndId
If Not (aWndClass = "Progman") And Not (aWndClass = "AutoHotkeyGui") And Not (aWndClass = "DesktopBackgroundClass") {
WinGetPos, aWndX, aWndY, aWndWidth, aWndHeight, ahk_id %aWndId%
If (Monitor_get(aWndX + aWndWidth / 2, aWndY + aWndHeight / 2) = Manager_aMonitor)
View_#%Manager_aMonitor%_#%aView%_aWndId := aWndId
}
}
Manager_aMonitor := Manager_loop(Manager_aMonitor, d, 1, Manager_monitorCount)
@ -111,8 +114,8 @@ Manager_applyRules(wndId, ByRef isManaged, ByRef m, ByRef tags, ByRef isFloating
WinGetPos, wndX, wndY, wndWidth, wndHeight, ahk_id %wndId%
WinGet, wndStyle, Style, ahk_id %wndId%
If wndClass And wndTitle And Not (wndX < -4999) And Not (wndY < -4999) {
Loop, % Config_rulesCount {
StringSplit, rule, Config_rules_#%A_index%, `;
Loop, % Config_ruleCount {
StringSplit, rule, Config_rule_#%A_index%, `;
If RegExMatch(wndClass . ";" . wndTitle, rule1 . ";" . rule2) And (rule3 = "" Or wndStyle & rule3) { ; The last matching rule is returned.
isManaged := rule4
m := rule5
@ -122,13 +125,8 @@ Manager_applyRules(wndId, ByRef isManaged, ByRef m, ByRef tags, ByRef isFloating
hideTitle := rule9
}
}
If (m = 0) {
If Config_monitorFollowsMouse {
MouseGetPos, mouseX, mouseY
m := Monitor_get(mouseX, mouseY)
} Else
m := Manager_aMonitor
}
If (m = 0)
m := Manager_aMonitor
If (m > Manager_monitorCount) ; If the specified monitor is out of scope, set it to the max. monitor.
m := Manager_monitorCount
If (tags = 0)
@ -195,7 +193,7 @@ Manager_closeWindow() {
WinGet, aWndId, ID, A
WinGetClass, aWndClass, ahk_id %aWndId%
WinGetTitle, aWndTitle, ahk_id %aWndId%
If Not (aWndClass = "AutoHotkeyGUI" And RegExMatch(aWndTitle, "BUGN_BAR_[0-9]+_[0-9]+"))
If Not (aWndClass = "AutoHotkeyGUI" And RegExMatch(aWndTitle, "bug.n_BAR_[0-9]+"))
WinClose, ahk_id %aWndId%
}
@ -330,7 +328,7 @@ Manager_moveWindow() {
}
Manager_onShellMessage(wParam, lParam) {
Local a, aWndHeight, aWndId, aWndWidth, aWndX, aWndY, flag, m, tags, wndClass, wndPName, wndTitle
Local a, aWndClass, aWndHeight, aWndId, aWndTitle, aWndWidth, aWndX, aWndY, flag, m, tags, wndClass, wndId, wndPName, wndTitle, x, y
SetFormat, Integer, hex
lParam := lParam+0
@ -339,21 +337,30 @@ Manager_onShellMessage(wParam, lParam) {
WinGetTitle, wndTitle, ahk_id %lParam%
WinGet, wndPName, ProcessName, ahk_id %lParam%
WinGet, aWndId, ID, A
WinGetClass, aWndClass, ahk_id %aWndId%
WinGetTitle, aWndTitle, ahk_id %aWndId%
If ((wParam = 4 Or wParam = 32772) And lParam = 0 And aWndClass = "Progman" And aWndTitle = "Program Manager") {
MouseGetPos, x, y
m := Monitor_get(x, y)
If m
Manager_aMonitor := m
Bar_updateTitle()
}
If (wParam = 1 Or wParam = 2 Or wParam = 4 Or wParam = 6 Or wParam = 32772) And lParam And Not Manager_hideShow And Not Manager_focus {
If Not (wParam = 4 Or wParam = 32772) {
If Not wndClass And Not (wParam = 2) {
;Loop {
WinGetClass, wndClass, ahk_id %lParam%
If wndClass {
If (wndClass = "Emacs")
Sleep, % 12 * Config_shellMsgDelay
; Break
} Else
Sleep, %Config_shellMsgDelay%
WinGetClass, wndClass, ahk_id %lParam%
If wndClass {
If (wndClass = "Emacs")
Sleep, % 12 * Config_shellMsgDelay
} Else
Sleep, %Config_shellMsgDelay%
}
}
If (wParam = 1 Or wParam = 6) And Not InStr(Manager_allWndIds, lParam . ";")
If (wParam = 1 Or wParam = 6) And Not InStr(Manager_allWndIds, lParam ";") And Not InStr(Manager_managedWndIds, lParam ";")
a := Manager_manage(lParam)
Else {
flag := True
@ -366,15 +373,13 @@ Manager_onShellMessage(wParam, lParam) {
Bar_updateView(Manager_aMonitor, Monitor_#%Manager_aMonitor%_aView_#1)
}
If flag {
WinGet, aWndId, ID, A
If flag
If (Manager_monitorCount > 1) {
WinGetPos, aWndX, aWndY, aWndWidth, aWndHeight, ahk_id %aWndId%
m := Monitor_get(aWndX+aWndWidth/2, aWndY+aWndHeight/2)
m := Monitor_get(aWndX + aWndWidth / 2, aWndY + aWndHeight / 2)
If m
Manager_aMonitor := m
}
}
If tags
Loop, % Config_viewCount
@ -529,7 +534,7 @@ Manager_unmanage(wndId) {
Manager_#%wndId%_tags :=
Manager_#%wndId%_isDecorated :=
Manager_#%wndId%_isFloating :=
StringReplace, Bar_hideTitleWndIds, Bar_hideTitleWndIds, %wndId%`;, , All
StringReplace, Bar_hideTitleWndIds, Bar_hideTitleWndIds, %wndId%`;,
StringReplace, Manager_allWndIds, Manager_allWndIds, %wndId%`;,
StringReplace, Manager_managedWndIds, Manager_managedWndIds, %wndId%`;, , All

View file

@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @version 8.2.0.03 (27.07.2011)
* @version 8.2.0.03 (21.08.2011)
*/
Monitor_init(m) {
@ -26,13 +26,13 @@ Monitor_init(m) {
Monitor_#%m%_showBar := Config_showBar
Loop, % Config_viewCount
View_init(m, A_Index)
Session_restore("Monitor", m)
Config_restore("Monitor", m)
Monitor_getWorkArea(m)
Bar_init(m)
}
Monitor_activateView(v) {
Local aView, aWndClass, aWndId, wndId, wndIds
Local aView, aWndClass, aWndId, m, n, wndId, wndIds
If (v = -1)
v := Monitor_#%Manager_aMonitor%_aView_#2
@ -48,23 +48,36 @@ Monitor_activateView(v) {
If Not (aWndClass = "Progman") And Not (aWndClass = "AutoHotkeyGui") And Not (aWndClass = "DesktopBackgroundClass")
View_#%Manager_aMonitor%_#%aView%_aWndId := aWndId
}
Monitor_#%Manager_aMonitor%_aView_#2 := aView
Monitor_#%Manager_aMonitor%_aView_#1 := v
Manager_hideShow := True
StringTrimRight, wndIds, View_#%Manager_aMonitor%_#%aView%_wndIds, 1
Loop, PARSE, wndIds, `;
If Not (Manager_#%A_LoopField%_tags & (1 << v - 1))
WinHide, ahk_id %A_LoopField%
StringTrimRight, wndIds, View_#%Manager_aMonitor%_#%v%_wndIds, 1
Loop, PARSE, wndIds, `;
WinShow, ahk_id %A_LoopField%
Manager_hideShow := False
n := Config_syncMonitorViews
If (n = 1)
n := Manager_monitorCount
Else If (n < 1)
n := 1
Loop, % n {
If (n = 1)
m := Manager_aMonitor
Else
m := A_Index
Bar_updateView(Manager_aMonitor, aView)
Bar_updateView(Manager_aMonitor, v)
Monitor_#%m%_aView_#2 := aView
Monitor_#%m%_aView_#1 := v
View_arrange(Manager_aMonitor, v)
Manager_hideShow := True
StringTrimRight, wndIds, View_#%m%_#%aView%_wndIds, 1
Loop, PARSE, wndIds, `;
If Not (Manager_#%A_LoopField%_tags & (1 << v - 1))
WinHide, ahk_id %A_LoopField%
StringTrimRight, wndIds, View_#%m%_#%v%_wndIds, 1
Loop, PARSE, wndIds, `;
WinShow, ahk_id %A_LoopField%
Manager_hideShow := False
Bar_updateView(m, aView)
Bar_updateView(m, v)
View_arrange(m, v)
}
wndId := View_#%Manager_aMonitor%_#%v%_aWndId
If Not (wndId And WinExist("ahk_id" wndId)) {
@ -132,7 +145,7 @@ Monitor_getWorkArea(m) {
}
}
If Monitor_#%m%_showBar {
If (Config_verticalBarPos = "top") {
If (Config_verticalBarPos = "top" Or (Config_verticalBarPos = "tray" And Not m = Manager_taskBarMonitor)) {
bTop := monitorTop
monitorTop += Bar_height
} Else If (Config_verticalBarPos = "bottom") {

View file

@ -1,91 +0,0 @@
/**
* bug.n - tiling window management
* Copyright (c) 2010-2011 joten
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @version 8.2.0.03 (24.07.2011)
*/
Session_restore(section, m=0) {
Local i, type, var, var0, var1, var2
If FileExist(Config_sessionFilePath) {
If (section = "Config") {
Loop, READ, %Config_sessionFilePath%
If (SubStr(A_LoopReadLine, 1, 7) = "Config_") {
StringSplit, var, A_LoopReadLine, =
type := SubStr(var1, 1, 13)
If (type = "Config_hotkey")
Config_hotkeyCount += 1
Else If (type = "Config_rules_") {
i := SubStr(var1, 14)
If (i > Config_rulesCount) {
Config_rulesCount += 1
i := Config_rulesCount
var1 := "Config_rules_#" i
}
}
%var1% := var2
}
} Else If (section = "Monitor") {
Loop, READ, %Config_sessionFilePath%
If (SubStr(A_LoopReadLine, 1, 10+StrLen(m)) = "Monitor_#" m "_" Or SubStr(A_LoopReadLine, 1, 8+StrLen(m)) = "View_#" m "_#") {
StringSplit, var, A_LoopReadLine, =
%var1% := var2
}
}
}
}
Session_save() {
Local m, text
text := "; bug.n - tiling window management`n; @version " VERSION " (" A_DD "." A_MM "." A_YYYY ")`n`n"
If FileExist(Config_sessionFilePath) {
Loop, READ, %Config_sessionFilePath%
If (SubStr(A_LoopReadLine, 1, 7) = "Config_")
text .= A_LoopReadLine "`n"
text .= "`n"
}
FileDelete, %Config_sessionFilePath%
Loop, % Manager_monitorCount {
m := A_Index
If Not (Monitor_#%m%_aView_#1 = 1)
text .= "Monitor_#" m "_aView_#1=" Monitor_#%m%_aView_#1 "`n"
If Not (Monitor_#%m%_aView_#2 = 1)
text .= "Monitor_#" m "_aView_#2=" Monitor_#%m%_aView_#2 "`n"
If Not (Monitor_#%m%_showBar = Config_showBar)
text .= "Monitor_#" m "_showBar=" Monitor_#%m%_showBar "`n"
Loop, % Config_viewCount {
If Not (View_#%m%_#%A_Index%_layout_#1 = 1)
text .= "View_#" m "_#" A_Index "_layout_#1=" View_#%m%_#%A_Index%_layout_#1 "`n"
If Not (View_#%m%_#%A_Index%_layout_#2 = 1)
text .= "View_#" m "_#" A_Index "_layout_#2=" View_#%m%_#%A_Index%_layout_#2 "`n"
If Not (View_#%m%_#%A_Index%_layoutAxis_#1 = Config_layoutAxis_#1)
text .= "View_#" m "_#" A_Index "_layoutAxis_#1=" View_#%m%_#%A_Index%_layoutAxis_#1 "`n"
If Not (View_#%m%_#%A_Index%_layoutAxis_#2 = Config_layoutAxis_#2)
text .= "View_#" m "_#" A_Index "_layoutAxis_#2=" View_#%m%_#%A_Index%_layoutAxis_#2 "`n"
If Not (View_#%m%_#%A_Index%_layoutAxis_#3 = Config_layoutAxis_#3)
text .= "View_#" m "_#" A_Index "_layoutAxis_#3=" View_#%m%_#%A_Index%_layoutAxis_#3 "`n"
If Not (View_#%m%_#%A_Index%_layoutMFact = Config_layoutMFactor)
text .= "View_#" m "_#" A_Index "_layoutMFact=" View_#%m%_#%A_Index%_layoutMFact "`n"
If Not (View_#%m%_#%A_Index%_layoutMSplit = 1)
text .= "View_#" m "_#" A_Index "_layoutMSplit=" View_#%m%_#%A_Index%_layoutMSplit "`n"
}
}
FileAppend, %text%, %Config_sessionFilePath%
}

View file

@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @version 8.2.0.03 (24.07.2011)
* @version 8.2.0.03 (11.08.2011)
*/
View_init(m, v) {
@ -74,7 +74,7 @@ View_getTiledWndIds(m, v, ByRef tiledWndIds) {
StringTrimRight, wndIds, View_#%m%_#%v%_wndIds, 1
Loop, PARSE, wndIds, `;
{
If Not Manager_#%A_LoopField%_isFloating {
If Not Manager_#%A_LoopField%_isFloating And WinExist("ahk_id " A_LoopField) {
n += 1
tiledWndIds .= A_LoopField ";"
}
@ -321,5 +321,6 @@ View_toggleFloating() {
If (Config_layoutFunction_#%l% And InStr(Manager_managedWndIds, aWndId ";")) {
Manager_#%aWndId%_isFloating := Not Manager_#%aWndId%_isFloating
View_arrange(Manager_aMonitor, v)
Bar_updateTitle()
}
}

102
src/docs/changes.t2t Normal file
View file

@ -0,0 +1,102 @@
**Legend**
(-) deleted
(~) changed
(+) added
=8.2.0=
==Configuration==
(-) 'Config_addRunCommands' (the 'Run' item in 'command GUI').
(-) 'Config_sessionFilePath'
(-) 'Config_topBar' (replaced by 'Config_verticalBarPos'.
(~) Brackets are no longer used for array names ('[i]' -> '_#i').
(~) The default values for the color and font size of the status bar
are now retrieved from the system settings.
- 'Config_normBgColor'
- 'Config_normFgColor'
- 'Config_selBgColor'
- 'Config_selFgColor'
- 'Config_fontSize'
(+) Default rules
(+) 'Config_hotkey' (setting hotkeys in 'Config.ini').
(+) 'Config_horizontalBarPos' (The horizontal position of the bar:
'center', 'left' or 'right' side of the monitor or an offset in
pixel (px) from the left (>= 0) or right (< 0).
(+) 'Config_verticalBarPos' (The vertical position of the bar: 'top'
or 'bottom' of the monitor, 'tray' = sub-window of the task bar.
(+) 'Config_barWidth' (The width of the bar in pixel (px) or with a
per cent sign (%) as a percentage.
(+) 'Config_singleRowBar' (If false, the bar will have to rows, one
for the window title and one for all other GUI controls.
(+) 'Config_spaciousBar' (If true, the height of the bar will be set
to a value equal to the height of an edit control, else it will
be set to the text height.
(+) 'Config_syncMonitorViews' (The number of monitors (2 or more),
for which views should be activated, when using the accordant
hotkey. If set to 1, the views are actiated for all monitors. If
set to 0, views are activated independently (only on the active
monitor).
==Hotkeys==
(~) Changed hotkeys
- #s -> #^s::Config_saveSession()
- #+r -> #^r::Reload
- #+q -> #^q::ExitApp
(+) #y::Bar_toggleCommandGui() (Open the command GUI for executing
programmes or bug.n functions.)
(+) #^e::Run, edit, %Config_sessionFilePath% (Open the session file
in the standard text editor.
(+) "<" and ">" as an argument for 'Monitor_activateView'.
(+) "<" and ">" as an argument for 'Monitor_setWindowTag'.
==Debugging==
(~) 'tile' function: resetting msplit
(~) 'Manager_winActivate(wndId)' now does not activate 'Program
Manager', if there is no window on the view, but sets the mouse
pointer to the center of the active monitor.
(~) 'Bar_updateTitle()' now indicates the floating state of a window.
(~) A memory leak in 'Manager_managedWndIds' was removed.
(~) Now mouse-follows-focus does also work in 'View_shuffleWindow(d)'.
(~) The 'anyText' field in the status bar is now updated correctly.
(~) The positioning of the 'command GUI' has been corrected for the
case of a bar at the bottom of the screen.
(~) Empty cells (for not existing, but registered windows) in the
'tile' layout were removed.
(+) AutoHotkey_L compatibility
- (~) Brackets are no longer used for array names ('[i]' -> '_#i').
- (~) Getting system settings (ANSI vs. UTF-8)
(+) 'Manager_maximizeWindow()' to 'command GUI'
(+) 'View_shuffleWindow(d)' does now work in a loop (last <-> first
window).
(+) 'Manager_taskBarMonitor' for allowing the task bar on another
than the first monitor
(+) If the status bar is not put in the task bar, the status bar is
registered as an AppBar and therewith changes the windows
workspace.
==General==
(~) The number of windows on a view is not indicated by different
background colors anymore, but by a progress bar.
(~) The battery status is also indicated with a progress bar.
(~) All bar elements are now put in a single window.
(~) Session.ahk was merged into Config.ahk and Session.ini moved to
Config.ini.
(+) Shell event: 32772
(+) A monitor with no windows on it can now be activated by cklicking
on the desktop and therewith changing the active window.
=8.1.0=
(-) 'Config_showTitleBars'
(~) 'Config_rules' have two more parameters (window style and if the
window is decorated; this replaces 'Config_showTitleBars').
(~) A bug is solved, which occurred when opening a web link from
another application than the web browser itself, e. g. a mail
client.
(+) WIN+SHIFT+X maximizes a window to the bug.n workspace.
(+) You may now use 'Monitor_activateView(">")' for cycling through
the views and 'View_setLayout(">")' for cycling through the
layouts.

View file

@ -1,9 +1,9 @@
%!encoding: iso-8859-1
%!encoding: utf-8
%!options(html): --css-sugar -o configuration.html
%!style(html): ../styles.css
%!preproc(html): '%%html: ' ''
%!postproc(html): '<HEAD>' '<HEAD>\n<TITLE>joten @ AutoHotkey</TITLE>'
%!postproc(html): '<HEAD>' '<HEAD>\n<TITLE>bug.n configuration variables</TITLE>'
%!postproc(html): '<HEAD>' '<HEAD>\n<LINK REL="icon" HREF="../images/jn.ico" />'
%!postproc(html): '<HEAD>' '<HEAD>\n<META NAME="author" CONTENT="joten" />'
%!postproc(html): '<HEAD>' '<HEAD>\n<META NAME="keywords" CONTENT="AutoHotkey, joten, bug.n, tiling, window management" />'
@ -20,67 +20,85 @@
=== bug.n GUI ===
: **Config_showBar**=1
If false (=0), the bar is hidden. It can be made visible or hidden by hotkey.
If false (=0), the bar is hidden. It can be made visible or hidden by
hotkey (see below).
: **Config_topBar**=1
If false (=0), the bar is at the bottom.
: **Config_horizontalBarPos**=left
The horizontal position of the bar: center, left or right side of the
monitor or an offset in pixel (px) from the left (>= 0) or right (< 0).
: **Config_verticalBarPos**=top
The vertical position of the bar: top or bottom of the monitor,
tray = sub-window of the task bar.
: **Config_barWidth**=100%
The width of the bar in pixel (px) or with a per cent sign (%) as a
percentage.
: **Config_singleRowBar**=1
If false, the bar will have to rows, one for the window title and one
for all other GUI controls.
: **Config_spaciousBar**=0
If true, the height of the bar will be set to a value equal to the
height of an edit control, else it will be set to the text height.
: **Config_fontName**=Lucida Console
A monospace font is preferable for bug.n to calculate the correct width
of the bar and its elements (sub-windows).
: **Config_fontSize**=
: **Config_fontSize**=<fontsize_captiontext>
Font size in pixel. The default value is retrieved from the "Window
Color and Appearance" settings for the "Active Title Bar".
: **Config_normBgColor**=
Normal background color of bar elements. The first color is the color
for views without windows and the title bar (default: COLOR_MENU), the
second color is the first for the 'window count gradient' (default:
COLOR_INACTIVECAPTION) indicating one window on a view, the third color
is the second for the 'window count gradient' (default:
COLOR_GRADIENTINACTIVECAPTION) indicating ten or more windows, the color
indicating two to nine windows is calculated by bug.n. Beside defining
those three colors in the format "RRGGBB;RRGGBB;RRGGBB", you may also
explicitly define all ten colors. The default values are retrieved from
the "Window Color and Appearance" settings for the "Inactive Title
Bar".
: **Config_normBgColor**=<COLOR_MENU>;<COLOR_INACTIVECAPTION>;<COLOR_GRADIENTINACTIVECAPTION>;Red;<COLOR_GRADIENTINACTIVECAPTION>
The normal background color of bar elements. The first value is the
color for views without windows, the title bar and time. The second
value is the color for the layout symbol, the any-text (i. a. date) and
the button for the command GUI (#!). The third value is the background
color of the progress bar indicating an inactive view and a charging
battery, the fourth value is the background color of the progress bar
indicating a discharging battery with a remaining charge of less than
ten percent, the fifth value is the background color of the progress
bar indicating a charging battery. The default values are retrieved
from the "Window Color and Appearance" settings.
: **Config_normFgColor**=
Normal foreground (i. e. text) color of bar elements as described
above. The default values are retrieved from the "Window Color and
Appearance" settings for the "Inactive Title Bar".
: **Config_normFgColor**=<COLOR_MENUTEXT>;Default;<COLOR_INACTIVECAPTION>;<COLOR_INACTIVECAPTIONTEXT>;<COLOR_HIGHLIGHT>;White;Default;<COLOR_INACTIVECAPTION>
The normal foreground color of bar elements. The first two values are
the text colors for the first two elements as described above. The
third value is the forground color of the progress bar and the fourth
value the text color indicating an inactive view and a charging
battery. The fifth value is the foreground color of a progress bar
indicating a discharging battery. The sixth value is the text color
indicating a dischargin battery with a remaining charge of less than
ten percent. The seventh value is the text color indicating a charging
battery. The eighth value is the foreground color of a progress bar
indicating a chargin battery. The default values are retrieved from the
"Window Color and Appearance" settings.
: **Config_selBgColor**=
Background colour of 'selected' or highlighted bar elements. The first
colour is used for the active view (default: COLOR_HIGHLIGHT), the
second color is used for the first status information field (default:
COLOR_ACTIVECAPTION), the third color is used for the status information
indicating a decreasing battery level, the layout symbol and the command
symbol, which is the last field in the status bar (default:
COLOR_GRADIENTACTIVECAPTION), the fourth color is used for an alarming
battery level (default: inverted COLOR_ACTIVECAPTION). The additional
status information fields get colors from the gradient calculated by
bug.n from the first and last status information field. The default
values are retrieved from the "Window Color and Appearance" settings for
the "Active Title Bar" and "Selected Items".
: **Config_selBgColor**=<COLOR_GRADIENTACTIVECAPTION>
The background color of a progress bar indicating an active view or
discharging battery status. The default values are retrieved from the
"Window Color and Appearance" settings.
: **Config_selFgColor**=
Foreground colour of 'selected' or highlighted bar elements as described
above. The default values are retrieved from the "Window Color and
Appearance" settings for the "Active Title Bar" and "Selected Items".
: **Config_selFgColor**=<COLOR_CAPTIONTEXT>;<COLOR_ACTIVECAPTION>
The first color is the text color, the second the foreground color of a
progress bar indicating an active view or discharging battery status.
The default values are retrieved from the "Window Color and Appearance"
settings.
: **Config_readinBat**=0
If true (=1), the system battery status is read in and displayed in
the status bar. This only makes sense, if you have a system battery
If true (=1), the system battery status is read in and displayed in the
status bar. This only makes sense, if you have a system battery
(notebook).
: **Config_readinCpu**=0
If true (=1), the current CPU load is read in and displayed in the status bar.
If true (=1), the current CPU load is read in and displayed in the
status bar.
: **Config_readinDate**=1
If true (=1), the current date is read in (format: "WW, DD. MMM.
YYYY") and displayed in the status bar.
If true (=1), the current date is read in (format: "WW, DD. MMM. YYYY")
and displayed in the status bar.
: **Config_readinTime**=1
If true (=1), the current time is read in (format: "HH:MM") and
@ -94,9 +112,9 @@
: **Config_bbCompatibility**=0
If true (=1), bug.n looks for BlackBox components (bbLeanBar, bbSlit
and SystemBarEx) when calculating the work area. It is assumed that
the virtual desktop functionality of BlackBox and NOT bug.n is used
(**=> Hiding and showing windows is detected and acted upon).
and SystemBarEx) when calculating the work area. It is assumed that the
virtual desktop functionality of BlackBox and NOT bug.n is used
(=> Hiding and showing windows is detected and acted upon).
: **Config_borderWidth**=0
If > 0, the window border width is set to the integer value
@ -104,38 +122,53 @@
: **Config_borderPadding**=-1
If >= 0, the window border padding is set to the integer value
Config_borderPadding (only for Windows >**= Vista).
Config_borderPadding (only for Windows >= Vista).
: **Config_showTaskBar**=0
If false (=0), the task bar is hidden. It can be made visible or
hidden by hotkey (see below).
If false (=0), the task bar is hidden. It can be made visible or hidden
by hotkey (see below).
: **Config_showBorder**=1
If false (=0), the window borders are hidden; therefor windows cannot
be resized manually by dragging the border, even if using the
according hotkey.
be resized manually by dragging the border, even if using the according
hotkey.
: **Config_selBorderColor**=
Border colour of the active window; format: 0x00BBGGRR (e. g.
"0x006A240A", if empty, the system's window border colour is not
"0x006A240A", if = "", the system's window border colour is not
changed).
Config_borderWidth, Config_borderPadding and Config_selBorderColor are
especially usefull, if you are not allowed to set the design in the system
settings.
=== View / Layout ===
: **Config_viewCount**=9
The total number of views. This has effects on the displayed groups in
the bar, and should not be exceeded in the hotkeys below.
: **Config_layoutAxis[1]**=1
: **Config_layout_#1**=[]=;tile
The layout symbol and arrange function (the first entry is set as the
default layout, no layout function means floating behavior)
: **Config_layout_#2**=[M];monocle
: **Config_layout_#3**=><>;
: **Config_layoutCount**=3
Total number of layouts defined above.
: **Config_layoutAxis_#1**=1
The layout axis: 1 = x, 2 = y; negative values mirror the layout,
setting the master area to the right / bottom instead of left / top.
: **Config_layoutAxis[2]**=2
: **Config_layoutAxis_#2**=2
The master axis: 1 = x (from left to right), 2 = y (from top to
bottom), 3 = z (monocle).
: **Config_layoutAxis[3]**=2
: **Config_layoutAxis_#3**=2
The stack axis: 1 = x (from left to right), 2 = y (from top to
bottom), 3 = z (monocle).
@ -155,73 +188,79 @@
or the focus has been changed); if there are any problems recognizing,
when windows are opened or closed, try to increase this number.
: **Config_syncMonitorViews**=0
The number of monitors (2 or more), for which views should be
activated, when using the accordant hotkey. If set to 1, the views are
actiated for all monitors. If set to 0, views are activated
independently (only on the active monitor).
: **Config_viewFollowsTagged**=0
If true (=1), the view is set to, if a window is tagged with a single
tag.
If true (=1) and a window is tagged with a single tag, the view is
correspondingly set to the tag.
=== Rules ===
: **Config_rules[1]**=.*;.*;;1;0;0;0;0;0
At first you may set a default rule (.*;.*;) for a default monitor,
view and / or showing window title bars. General format:
Config_rules[i]=<class (regular expression string)>;<title (regular
expression string)>;<window style (hexadecimal number or blank)>;<is
managed (1 = True or 0 = False)>;<monitor (0 <= integer <= total number
of monitors, 0 means the currently active monitor)>;<tags (binary mask
as integer >= 0, e. g. 17 for 1 and 5, 0 means the currently active
tag)>;<is floating (1 = True or 0 = False)>;<is decorated (1 = True or
0 = False)>;<hide title (1 = True or 0 = False)>" (";" is not allowed
as a character).
: **Config_rule_#1**=.*;.*;;1;0;0;0;0;0
If you want to replace a default rule, you will have to use the
correct variable name, e. g. you may set a rule (.*;.*;) for a default
monitor, view and / or showing window title bars by setting the first
rule "Config_rule_#1=..." and therewith replacing the value.
If you want to add a rule you do not have to use a numbered variable,
but "Config_rule=..." (the numbering will be done automatically in the
order given in the configuration file). General format:
Config_rule[_#<i>]=<class (regular expression string)>;<title (regular
expression string)>;<window style (hexadecimal number or blank)>;
<is managed (1 = True or 0 = False)>;<monitor (0 <= integer <= total
number of monitors, 0 means the currently active monitor)>;<tags
(binary mask as integer >= 0, e. g. 17 for 1 and 5, 0 means the
currently active tag)>;<is floating (1 = True or 0 = False)>;
<is decorated (1 = True or 0 = False)>;<hide title (1 = True or
0 = False)>
(all in one line, ";" is not allowed as a character)
: **Config_rules[2]**=.*;.*;0x80000000;0;0;0;1;1;1
: **Config_rule_#2**=.*;.*;0x80000000;0;0;0;1;1;1
Pop-up windows (style WS_POPUP=0x80000000) will not be managed, are
floating and the titles are hidden.
: **Config_rules[3]**=SWT_Window0;.*;;1;0;0;0;0;0
: **Config_rule_#3**=SWT_Window0;.*;;1;0;0;0;0;0
Windows created by Java (SWT) e. g. Eclipse have the style WS_POPUP,
but should excluded from the above rule.
: **Config_rules[4]**=Xming;.*;;1;0;0;0;0;0
Xming windows have the style WS_POPUP, but should be excluded from the
above rule.
: **Config_rule_#4**=Xming;.*;;1;0;0;0;0;0
Xming windows have the style WS_POPUP, but should be excluded from
the above rule.
: **Config_rules[5]**=_sp;_sp;;1;0;0;1;0;1
: **Config_rules[6]**=MozillaDialogClass;.*;;1;0;0;1;1;0
: **Config_rules[7]**=MsiDialog(No)?CloseClass;.*;;1;0;0;1;1;0
: **Config_rules[8]**=gdkWindowToplevel;GIMP-Start;;1;0;0;1;1;0
: **Config_rules[9]**=gdkWindowToplevel;GNU Image Manipulation Program;;1;0;0;1;1;0
: **Config_rules[10]**=gdkWindowToplevel;Werkzeugkasten;;1;0;0;1;1;0
: **Config_rules[11]**=gdkWindowToplevel;Ebenen, .* - Pinsel, Muster, .*;;1;0;0;1;1;0
: **Config_rules[12]**=gdkWindowToplevel;Toolbox;;1;0;0;1;1;0
: **Config_rules[13]**=gdkWindowToplevel;Layers, Channels, Paths, .*;;1;0;0;1;1;0
: **Config_rules[14]**=CalcFrame;.*;;1;0;0;1;1;0
: **Config_rulesCount**=14
The total number of active rules above.
Using an indexing number less or equal to "Config_rulesCount" replaces
this rule. Additional rules need an increasing indexing number higher
than the value for "Config_rulesCount".
: **Config_rule_#5**=MsiDialog(No)?CloseClass;.*;;1;0;0;1;1;0"
: **Config_rule_#6**=AdobeFlashPlayerInstaller;.*;;1;0;0;1;0;1"
: **Config_rule_#7**=CalcFrame;.*;;1;0;0;1;1;0"
: **Config_rule_#8**=_sp;_sp;;1;0;0;1;0;1"
: **Config_rule_#9**=MozillaDialogClass;.*;;1;0;0;1;1;0"
: **Config_rule_#10**=gdkWindowToplevel;GIMP-Start;;1;0;0;1;1;0"
: **Config_rule_#11**=gdkWindowToplevel;GNU Image Manipulation Program;;1;0;0;1;1;0"
: **Config_rule_#12**=gdkWindowToplevel;Werkzeugkasten;;1;0;0;1;1;0"
: **Config_rule_#13**=gdkWindowToplevel;Ebenen, .* - Pinsel, Muster, .*;;1;0;0;1;1;0"
: **Config_rule_#14**=gdkWindowToplevel;Toolbox;;1;0;0;1;1;0"
: **Config_rule_#15**=gdkWindowToplevel;Layers, Channels, Paths, .*;;1;0;0;1;1;0"
=== Session management ===
: **Config_autoSaveSession**=0
Automatically save the current state of monitors, views, layouts
(active view, layout, axes, mfact and msplit) to te session file (set
below) when quitting bug.n.
Automatically save the current state of monitors, views, layouts (active
view, layout, axes, mfact and msplit) to the configuration file when
quitting bug.n.
=== Hotkeys ===
: **Config_hotkey[i]**=<key name>::<command or function name>
: **Config_hotkey**=<key name>::<command or function name>
You may overwrite default or add new hotkeys by using the above
format. The indexing numbers ("i") should start with 1 and be
sequential. "<key name>::<command or function name>" is the original
format. "<key name>::<command or function name>" is the original
syntax from AutoHotkey as described in
http://www.autohotkey.com/docs/Hotkeys.htm.
- To deacivate a default hotkey as listed in %%LINK_hotkeys, add a new
line in the format "Config_hotkey[i]=<key name>::" (without a
line in the format "Config_hotkey=<key name>::" (without a
function name).
- To assign an internal function of bug.n to a new hotkey, add a line
as documented in %%LINK_hotkeys, but with the new key name.

View file

@ -1,9 +1,9 @@
%!encoding: iso-8859-1
%!encoding: utf-8
%!options(html): --css-sugar -o help.html
%!style(html): ../styles.css
%!preproc(html): '%%html: ' ''
%!postproc(html): '<HEAD>' '<HEAD>\n<TITLE>joten @ AutoHotkey</TITLE>'
%!postproc(html): '<HEAD>' '<HEAD>\n<TITLE>bug.n help</TITLE>'
%!postproc(html): '<HEAD>' '<HEAD>\n<LINK REL="icon" HREF="../images/jn.ico" />'
%!postproc(html): '<HEAD>' '<HEAD>\n<META NAME="author" CONTENT="joten" />'
%!postproc(html): '<HEAD>' '<HEAD>\n<META NAME="keywords" CONTENT="AutoHotkey, joten, bug.n, tiling, window management" />'
@ -77,7 +77,7 @@ There are three layouts.
=== Tagging ===
bug.n features an extended implementation of virtual desktops:
tagging.''<BR>''
//tagging//.''<BR>''
Windows are tagged with one or more numbers, which determine on which
views they are shown. Selecting a view shows the windows tagged with the
same number and hides all other windows.
@ -93,54 +93,31 @@ internal variables for the current state of bug.n, e. g. the active view
(saved for each monitor) and layout (saved for each view).
== Preliminary note ==
There are two forms in which you can run bug.n:
+ the compiled executable
+ the AutoHotkey script
Depending on which form you choose, the following procedures
(installing, running and customizing) are different. Using the compiled
executable may be easier but is also less flexible for customization.
== Installing and running bug.n ==
There is no installation wizard for bug.n. If you downloaded this
package and unpacked it, it should be in a directory, where you have
read and write access. This is the only requirement for using bug.n (at
least for saving the bug.n session file). Apart from that you may copy
bug.n to any directory.
+ If you choose to use the executable and want to save it to a
directory, to which you do not have write access, you will have to run
bug.n with a parameter indicating the file path to the session file
(<file path to the bug.n executable> <file path to the session file>),
e. g. "C:\Program Files\bugn\bugn.exe C:\Users\joten\bugn.ini".
+ If you choose to use the AutoHotkey script, you will need a version of
AutoHotkey (available from http://www.autohotkey.com/download) and a
file association for AutoHotkey scripts to the AutoHotkey executable
(*.ahk -> <file path to AutoHotkey.exe>). You will than have to run
"Main.ahk" from within the "source" directory of bug.n.
least for saving the bug.n configuration file). Apart from that you may
copy bug.n to any directory.
If you want to save it to a directory, to which you do not have write
access, you will have to run bug.n with a parameter indicating the file
path to the configuration file (<file path to the bug.n executable>
<file path to the session file>), e. g.
"C:\Program Files\bugn\bugn.exe C:\Users\joten\bugn.ini".
=== Microsoft Windows Vista / 7 and UAC ===
If you are using bug.n on Microsoft Windows Vista or 7 you may use
applications, which run with administrator privileges e. g.
administrative tools and therefor are not managed by bug.n. If you want
administrative tools and therefor are not managed by bug.n, if it is
run with an account, which //is// not the administrator. If you want
those applications to be managed, you need to run bug.n with
administrator privileges, too.
+ If you choose to use the executable, you can set the option "Run this
program as an administrator" on the "Compatiblity" tab, section
"Privilege level" of the bug.n executable file properties.
+ If you choose to use the AutoHotkey script, you will have to use a
command script like "run.cmd" provided in the "source" directory of
bug.n. Please adjust the file pathes in this file depending on your
working environment and than create a link to the file. In the file
properties of this link you can set the option "Run this program as an
administrator" on the "Compatiblity" tab, section "Privilege level".
You will than have to run bug.n through this link.
You can set the option "Run this program as an administrator" on the
"Compatiblity" tab, section "Privilege level" of the bug.n executable
file properties.
== Customization ==
@ -156,31 +133,19 @@ Customization can be done
- for hotkeys (the key bindings for the bug.n functions)
%%html: ''<P></P>''
+ If you use the executable, you can not change the layout symbols and
the order of the layouts. The available configuration variables are
listed in %%LINK_configuration.''<BR>''
To change these, first create a session file by using the hotkey
"WIN+CTRL+S". The file is either saved in the directory you specified
with the parameter to the executable, or in the same directory where the
executable is saved. You may then edit the file with a text editor
("WIN+CTRL+E" opens the file for editing) and add a new line for each
configuration variable with its value (format: <variable>=<value>, use
no quotation marks, 1 for true and 0 for false), e. g.
"Config_showBar=0". You will have to quit and run bug.n again for the
changes to take effect.
+ If you use the AutoHotkey script you can directly edit the file
"Config.ahk" in the "source" directory of bug.n and reload the script
with the hotkey "WIN+CTRL+R". You can additionally use the
configuration file as described above. Please refer to the
documentation of AutoHotkey for more information about writing an
AutoHotkey script, especially
- http://www.autohotkey.com/docs/Hotkeys.htm
- http://www.autohotkey.com/docs/Variables.htm
You may find a sample session file (Session_sample.ini) in the main
directory of bug.n.
The available configuration variables are listed in
%%LINK_configuration.''<BR>''
To change these, first create a session file by using the hotkey
"WIN+CTRL+S". The file is either saved in the directory you specified
with the parameter to the executable, or in the same directory where the
executable is saved. You may then edit the file with a text editor
("WIN+CTRL+E" opens the file for editing) and add a new line for each
configuration variable with its value (format: <variable>=<value>, use
no quotation marks, 1 for true and 0 for false), e. g.
"Config_showBar=0". You will have to quit and run bug.n again for the
changes to take effect.''<BR>''
You may find a sample configuration file (Config_example.ini) in the
main directory of bug.n.
== Usage ==

View file

@ -1,9 +1,9 @@
%!encoding: iso-8859-1
%!encoding: utf-8
%!options(html): --css-sugar -o hotkeys.html
%!style(html): ../styles.css
%!preproc(html): '%%html: ' ''
%!postproc(html): '<HEAD>' '<HEAD>\n<TITLE>joten @ AutoHotkey</TITLE>'
%!postproc(html): '<HEAD>' '<HEAD>\n<TITLE>bug.n hotkeys</TITLE>'
%!postproc(html): '<HEAD>' '<HEAD>\n<LINK REL="icon" HREF="../images/jn.ico" />'
%!postproc(html): '<HEAD>' '<HEAD>\n<META NAME="author" CONTENT="joten" />'
%!postproc(html): '<HEAD>' '<HEAD>\n<META NAME="keywords" CONTENT="AutoHotkey, joten, bug.n, tiling, window management" />'
@ -50,8 +50,8 @@ pressing the left Windows key and the shift key and the q key
the view.
: #+Enter::**View_shuffleWindow(0)**
Move the active window to the first position in the window list of the
view.
Move the active window to the first position in the window list of
the view.
: #c::**Manager_closeWindow()**
Close the active window.
@ -74,8 +74,8 @@ pressing the left Windows key and the shift key and the q key
floating windows).
: #i::**Manager_getWindowInfo()**
Get information for the active window (id, title, class, process name,
style, geometry, tags and floating state).
Get information for the active window (id, title, class, process
name, style, geometry, tags and floating state).
: #+i::**Manager_getWindowList()**
Get a window list for the active view (id, title and class).
@ -108,23 +108,23 @@ pressing the left Windows key and the shift key and the q key
"tile" layout).
: #^t::**View_rotateLayoutAxis(1, +1)**
Rotate the layout axis (i. e. 2 -> 1 = vertical layout, 1 -> 2 =
horizontal layout, only for the "tile" layout).
Rotate the layout axis (i. e. 2 -> 1 = vertical layout,
1 -> 2 = horizontal layout, only for the "tile" layout).
: #^Enter::**View_rotateLayoutAxis(1, +2)**
Mirror the layout axis (i. e. -1 -> 1 / 1 -> -1 = master on the left /
right side, -2 -> 2 / 2 -> -2 = master at top / bottom, only for the
"tile" layout).
Mirror the layout axis (i. e. -1 -> 1 / 1 -> -1 = master on the left
/ right side, -2 -> 2 / 2 -> -2 = master at top / bottom, only for
the "tile" layout).
: #^Tab::**View_rotateLayoutAxis(2, +1)**
Rotate the master axis (i. e. 3 -> 1 = x-axis = horizontal stack, 1 ->
2 = y-axis = vertical stack, 2 -> 3 = z-axis = monocle, only for the
"tile" layout).
Rotate the master axis (i. e. 3 -> 1 = x-axis = horizontal stack,
1 -> 2 = y-axis = vertical stack, 2 -> 3 = z-axis = monocle, only for
the "tile" layout).
: #^+Tab::**View_rotateLayoutAxis(3, +1)**
Rotate the stack axis (i. e. 3 -> 1 = x-axis = horizontal stack, 1 ->
2 = y-axis = vertical stack, 2 -> 3 = z-axis = monocle, only for the
"tile" layout).
Rotate the stack axis (i. e. 3 -> 1 = x-axis = horizontal stack,
1 -> 2 = y-axis = vertical stack, 2 -> 3 = z-axis = monocle, only for
the "tile" layout).
: #^Left::**View_setMSplit(+1)**
Move the master splitter, i. e. decrease the number of windows in the
@ -139,23 +139,23 @@ pressing the left Windows key and the shift key and the q key
: #BackSpace::**Monitor_activateView(-1)**
Activate the previously activated view. You may also use
Monitor_activateView(">") for activating the next / adjacent view.
Monitor_activateView("<") or Monitor_activateView(">") for activating
the previous or next adjacent view.
: #+0::**Monitor_setWindowTag(0)**
Tag the active window with all tags (1 ... 9).
Tag the active window with all tags (1 ... Config_viewCount). You may
also use Monitor_setWindowTag("<") or Monitor_setWindowTag(">") for
setting the tag of the previous or next adjacent to the current view.
: #<tag>::**Monitor_activateView(<tag>)**
Activate the view indicated by "<tag>" (choose one out of 1 ... 9), e.
g. #1::Monitor_activateView(1).
Activate the view (choose one out of 1 ... Config_viewCount).
: #+<tag>::**Monitor_setWindowTag(<tag>)**
Tag the active window indicated by "<tag>" (choose one tag out of 1
... 9), e. g. #+1::Monitor_setWindowTag(1).
Tag the active window (choose one tag out of 1 ... Config_viewCount).
: #^<tag>::**Monitor_toggleWindowTag(<tag>)**
Add / Remove the tag indicated by "<tag>" (1 ... 9) for the active
window, if it is not / is already set, e. g.
#^1::Monitor_toggleWindowTag(1).
Add / Remove the tag (1 ... Config_viewCount) for the active window,
if it is not / is already set.
=== Monitor related hotkeys ===
@ -194,16 +194,14 @@ pressing the left Windows key and the shift key and the q key
: #y::**Bar_toggleCommandGui()**
Open the command GUI for executing programmes or bug.n functions.
: #^e::**Run, edit, %Config_sessionFilePath%**
Open the session file in the standard text editor.
: #^e::**Run, edit %Config_filePath%
Open the configuration file in the standard text editor.
: #^s::**Session_save()**
Save the current state of monitors, views, layouts.
: #^s::**Config_saveSession()**
Save the current state of monitors, views, layouts to the
configuration file.
: #^r::**Reload**
For resetting the confguration, if running bug.n as an Autohotkey script.
: #^q::**ExitApp**
: #^q::**ExitApp
Quit bug.n, restore the default Windows UI and show all windows.
''<BR>''