Update various small things. Mostly QoL.
This commit is contained in:
parent
07d1d1663e
commit
0be9b56961
@ -25,6 +25,7 @@ PipeRead 'echo "InfoStoreAdd locker `cat $FVWM_USERDIR/.data/prefs/p
|
||||
|
||||
# [Current Theme]
|
||||
PipeRead 'echo "InfoStoreAdd theme `cat $FVWM_USERDIR/.data/prefs/cosmetics/theme`"'
|
||||
PipeRead 'echo "InfoStoreAdd cursor `cat $FVWM_USERDIR/.data/prefs/cosmetics/cursor`"'
|
||||
PipeRead 'echo "InfoStoreAdd pape `cat $FVWM_USERDIR/.data/prefs/cosmetics/pape`"'
|
||||
PipeRead 'echo "InfoStoreAdd std_font `cat $FVWM_USERDIR/.data/prefs/cosmetics/std_font`"'
|
||||
PipeRead 'echo "InfoStoreAdd ui_font `cat $FVWM_USERDIR/.data/prefs/cosmetics/ui_font`"'
|
||||
|
1
.data/prefs/cosmetics/cursor
Normal file
1
.data/prefs/cosmetics/cursor
Normal file
@ -0,0 +1 @@
|
||||
Lambda
|
@ -1 +1 @@
|
||||
$[FVWM_USERDIR]/assets/themes/AtariGem5/theme.conf
|
||||
Lambda
|
||||
|
@ -2,4 +2,5 @@
|
||||
Style * Font "$[infostore.std_font]"
|
||||
|
||||
# Load theme settings.
|
||||
Read $[infostore.theme]
|
||||
Read $[FVWM_USERDIR]/assets/themes/$[infostore.theme]/theme.conf
|
||||
Read $[FVWM_USERDIR]/assets/cursors/$[infostore.cursor]/theme.conf
|
||||
|
@ -15,5 +15,6 @@ Style Run... GrabFocus,WindowListSkip,StaysOnTop,Sticky,PositionPlacement C
|
||||
Style XCalendar !Title,!Borders,!Handles,Sticky,StaysOnTop,WindowListSkip
|
||||
Style svkbd !Title,!Borders,!Handles,Sticky,StaysOnTop,WindowListSkip,NeverFocus
|
||||
Style XVkbd !Title,!Borders,!Handles,Sticky,StaysOnTop,WindowListSkip,NeverFocus
|
||||
|
||||
# This is an icon-free zone, ma'am.
|
||||
Style * NoIcon
|
||||
|
3
mainrc
3
mainrc
@ -23,3 +23,6 @@ AddToFunc StartFunction
|
||||
+ I Function PrefFunc
|
||||
+ I Function ModuleFunc
|
||||
+ I Schedule 250 Function DaemonFunc
|
||||
|
||||
# This setting is useful if you have a multi-head system.
|
||||
EdgeScroll 0 0
|
||||
|
@ -1,799 +0,0 @@
|
||||
#
|
||||
# This file is a part of the NsCDE - Not so Common Desktop Environment
|
||||
# Author: Hegel3DReloaded
|
||||
# Licence: GPLv3
|
||||
#
|
||||
|
||||
UseGettext {$NSCDE_ROOT/share/locale;NsCDE-Occupy}
|
||||
WindowLocaleTitle {Occupy}
|
||||
WindowSize 302 302
|
||||
Colorset 22
|
||||
|
||||
Init
|
||||
Begin
|
||||
# Pick mode out of window context initially
|
||||
If $WinName == {} Then
|
||||
Begin
|
||||
ChangeLocaleTitle 2 {Select Workspace, pick a Window.}
|
||||
End
|
||||
Else
|
||||
Begin
|
||||
ChangeTitle 2 $WinName
|
||||
End
|
||||
|
||||
# Mode of operation
|
||||
Set $OpModeArg = (GetScriptArgument 1)
|
||||
|
||||
# Dynamic current values
|
||||
Set $DeskNo = (Add (GetScriptArgument 2) 1)
|
||||
Set $PageX = (GetScriptArgument 3)
|
||||
Set $PageY = (GetScriptArgument 4)
|
||||
|
||||
# Configured workspaces and pages static arguments
|
||||
Set $DesksNo = (Add (GetScriptArgument 5) -1)
|
||||
Set $PageMatrixX = (GetScriptArgument 6)
|
||||
Set $PageMatrixY = (GetScriptArgument 7)
|
||||
Set $PagesNo = (Mult $PageMatrixX $PageMatrixY)
|
||||
|
||||
# OpMode 1 is workspaces operation, OpMode 2 is pages mode of operation
|
||||
If $OpModeArg == {pg} Then
|
||||
Begin
|
||||
Set $OpMode = 2
|
||||
ChangeWindowTitle (Gettext {Occupy Page})
|
||||
End
|
||||
Else
|
||||
Begin
|
||||
Set $OpMode = 1
|
||||
ChangeWindowTitle (Gettext {Occupy Workspace})
|
||||
ChangeValue 5 $DeskNo
|
||||
End
|
||||
|
||||
# Keyboard shortcuts for navigation, toggling and action
|
||||
Key Escape A 10 1 {Quit}
|
||||
Key H A 11 1 {DisplayHelp}
|
||||
Key Help A 11 1 {DisplayHelp}
|
||||
Key F1 A 11 1 {DisplayHelp}
|
||||
Key A A 6 1 {AllToggle}
|
||||
Key Return A 1 6 {Move}
|
||||
Key Return C 1 6 {MoveGo}
|
||||
Key Down A 5 1 {Down}
|
||||
Key Up A 5 1 {Up}
|
||||
Key Space A 1 5 {ChangeOpMode}
|
||||
|
||||
Set $BtnFont = (GetOutput {$NSCDE_ROOT/bin/getfont -v -t normal -s medium -Z 14} 1 -1)
|
||||
ChangeFont 9 $BtnFont
|
||||
ChangeFont 11 $BtnFont
|
||||
ChangeFont 10 $BtnFont
|
||||
|
||||
Set $LabelFont = (GetOutput {$NSCDE_ROOT/bin/getfont -v -t normal -s medium -Z 11.5} 1 -1)
|
||||
ChangeFont 1 $LabelFont
|
||||
ChangeFont 5 $LabelFont
|
||||
ChangeFont 3 $LabelFont
|
||||
ChangeFont 4 $LabelFont
|
||||
|
||||
Set $SmallFont = (GetOutput {$NSCDE_ROOT/bin/getfont -v -t normal -s small -Z 10.5} 1 -1)
|
||||
ChangeFont 6 $SmallFont
|
||||
ChangeFont 7 $SmallFont
|
||||
ChangeFont 2 $SmallFont
|
||||
|
||||
#
|
||||
# Defaults for variables during initialization
|
||||
#
|
||||
|
||||
# Do not go with window
|
||||
Set $GoWithWindow = 0
|
||||
|
||||
# Not sticky
|
||||
Set $AllPages = 0
|
||||
Set $AllWorkspaces = 0
|
||||
Set $WorkspacesMode = {normal}
|
||||
Set $PagesMode = {normal}
|
||||
|
||||
# Starred states of Workspaces and Pages radio buttons
|
||||
Set $StarredWspSet = 0
|
||||
Set $StarredPgSet = 0
|
||||
Set $InitialDeskNo = $DeskNo
|
||||
Set $InitialPageNoSet = 0
|
||||
|
||||
# This takes care of handling sticky windows across workspaces as well as pages
|
||||
If $OpMode == 1 Then
|
||||
Begin
|
||||
Do {WindowId $[w.id] (StickyAcrossDesks) SendToModule Occupy SendString 6 1 AllToggle}
|
||||
End
|
||||
If $OpMode == 2 Then
|
||||
Begin
|
||||
Do {WindowId $[w.id] (StickyAcrossPages) SendToModule Occupy SendString 6 1 AllToggle}
|
||||
End
|
||||
Do {WindowId $[w.id] (StickyAcrossDesks) SendToModule Occupy SendString 6 2 Run}
|
||||
Do {WindowId $[w.id] (StickyAcrossPages) SendToModule Occupy SendString 6 3 Run}
|
||||
|
||||
# Locale stuff: Hack to keep leading or ending space(s)
|
||||
# which will be trimmed by LocaleTitle Widget directive.
|
||||
ChangeLocaleTitle 6 (GetTitle 6)
|
||||
ChangeLocaleTitle 7 (GetTitle 7)
|
||||
End
|
||||
|
||||
# Upper Left static "Window" label. Serves as execution and message passing
|
||||
# widget under the hood.
|
||||
Widget 1
|
||||
Property
|
||||
Size 4 20
|
||||
Position 4 10
|
||||
Type ItemDraw
|
||||
Flags NoReliefString NoFocus Right
|
||||
LocaleTitle {Window:}
|
||||
Font "xft:::pixelsize=15"
|
||||
Colorset 22
|
||||
Main
|
||||
Case message of
|
||||
# Accept list of workspaces in FvwmScript List menu format
|
||||
# send signal to workspaces radio button if mode of operation
|
||||
# is workspaces
|
||||
1 :
|
||||
Begin
|
||||
Set $WorkSpaces = (LastString)
|
||||
If $OpMode == 1 Then
|
||||
Begin
|
||||
SendSignal 3 1
|
||||
End
|
||||
End
|
||||
# Same as "1 :" but for pages
|
||||
2 :
|
||||
Begin
|
||||
Set $Pages = (LastString)
|
||||
If $OpMode == 2 Then
|
||||
Begin
|
||||
SendSignal 4 1
|
||||
End
|
||||
End
|
||||
# Accept $[w.id] from f_SendToOccupy, send it to "4 :" that will obtain
|
||||
# window name from it.
|
||||
3 :
|
||||
Begin
|
||||
Set $WinId = (LastString)
|
||||
Do {Current WindowId } $WinId { SendToModule Occupy SendString 1 4 $[w.name]}
|
||||
End
|
||||
# Get window name from "3 :", set it on widget 2
|
||||
4 :
|
||||
Begin
|
||||
Set $WinName = (LastString)
|
||||
|
||||
If $WinId == {$[w.id]} Then
|
||||
Begin
|
||||
Set $WinId = {}
|
||||
Set $WinName = {}
|
||||
End
|
||||
Else
|
||||
Begin
|
||||
Set $WinNameRest = (StrCopy $WinName 30 31)
|
||||
If $WinNameRest <> {} Then
|
||||
Begin
|
||||
Set $WinName = (StrCopy $WinName 1 29) {...'}
|
||||
End
|
||||
|
||||
ChangeTitle 2 $WinName
|
||||
End
|
||||
End
|
||||
# Accept keyboard shortcut SPACE to change mode of operation
|
||||
# between workspaces (1) and pages (2) ...
|
||||
5 :
|
||||
Begin
|
||||
If (LastString) == {ChangeOpMode} Then
|
||||
Begin
|
||||
If $OpMode == 1 Then
|
||||
Begin
|
||||
SendSignal 4 1
|
||||
End
|
||||
Else
|
||||
Begin
|
||||
SendSignal 3 1
|
||||
End
|
||||
End
|
||||
End
|
||||
# Accept action to finally move the window or to move it and go
|
||||
# with it on that workspace and/or page
|
||||
6 :
|
||||
Begin
|
||||
If (LastString) == {Move} Then
|
||||
Begin
|
||||
SendSignal 9 1
|
||||
End
|
||||
If (LastString) == {MoveGo} Then
|
||||
Begin
|
||||
SendSignal 7 1
|
||||
SendSignal 9 1
|
||||
End
|
||||
End
|
||||
End
|
||||
|
||||
# Window name from "1 4" goes here
|
||||
Widget 2
|
||||
Property
|
||||
Size 218 20
|
||||
Position 74 10
|
||||
Type ItemDraw
|
||||
Flags NoReliefString Left
|
||||
Title {}
|
||||
Colorset 22
|
||||
Font "xft:::pixelsize=14"
|
||||
End
|
||||
|
||||
# Toggle workspaces mode of operation
|
||||
Widget 3
|
||||
Property
|
||||
Size 100 0
|
||||
Position 4 38
|
||||
Type RadioButton
|
||||
Flags NoReliefString Right
|
||||
LocaleTitle {Workspaces:}
|
||||
Font "xft:::pixelsize=15"
|
||||
Colorset 22
|
||||
Value 1
|
||||
Main
|
||||
Case message of
|
||||
SingleClic :
|
||||
Begin
|
||||
SendSignal 3 1
|
||||
End
|
||||
1 :
|
||||
Begin
|
||||
ChangeValue 4 0
|
||||
ChangeValue 3 1
|
||||
ChangeValue 6 $AllWorkspaces
|
||||
Set $PagesListValue = (GetValue 5)
|
||||
|
||||
# This block takes care for putting (*) at the end of
|
||||
# Pages: label on its radio button when something is
|
||||
# changed from the initial default. Special case is 999
|
||||
# which represents sticky state. There is also procedure
|
||||
# for removing (*) when settings are put back as it was
|
||||
# initially.
|
||||
If $OpMode == 2 Then
|
||||
Begin
|
||||
If $PageNo <> {} Then
|
||||
Begin
|
||||
If $StarredPgSet <> 1 Then
|
||||
Begin
|
||||
If $PageNo == 999 Then
|
||||
Begin
|
||||
Set $InitialPageNo = 999
|
||||
End
|
||||
Else
|
||||
Begin
|
||||
Set $OrigPgTitle = (GetTitle 4)
|
||||
Set $StarredPgTitle = $OrigPgTitle {*}
|
||||
ChangeTitle 4 $StarredPgTitle
|
||||
Set $StarredPgSet = 1
|
||||
End
|
||||
End
|
||||
Else
|
||||
Begin
|
||||
If $PageNo == 999 Then
|
||||
Begin
|
||||
Set $InitialPageNo = 999
|
||||
End
|
||||
Do {Echo NNNNNNNNNNNNNNNNNNNNN: } $PageNo { --- } $InitialPageNo
|
||||
If $PageNo == $InitialPageNo Then
|
||||
Begin
|
||||
ChangeTitle 4 $OrigPgTitle
|
||||
Set $StarredPgSet = 0
|
||||
End
|
||||
End
|
||||
End
|
||||
End
|
||||
|
||||
# Normal is non-sticky, allworkspaces is sticky
|
||||
# allworkspaces DeskNo value is virtual place holder 999
|
||||
# $WorkspacesListValue puts back saved value when changing
|
||||
# mode of operation
|
||||
If $WorkspacesMode == {normal} Then
|
||||
Begin
|
||||
ChangeTitle 5 $WorkSpaces
|
||||
If $WorkspacesListValue == {} Then
|
||||
Begin
|
||||
Set $WorkspacesListValue = (GetValue 5)
|
||||
End
|
||||
ChangeValue 5 $WorkspacesListValue
|
||||
End
|
||||
Else
|
||||
Begin
|
||||
ChangeValue 6 1
|
||||
Set $DeskNo = 999
|
||||
ChangeLocaleTitle 5 { All Workspaces}
|
||||
ChangeValue 5 1
|
||||
End
|
||||
|
||||
ChangeWindowTitle (Gettext {Occupy Workspace})
|
||||
ChangeLocaleTitle 6 { All Workspaces}
|
||||
Set $OpMode = 1
|
||||
End
|
||||
End
|
||||
|
||||
# Toggle pages mode of operation
|
||||
Widget 4
|
||||
Property
|
||||
Size 100 0
|
||||
Position 4 68
|
||||
Type RadioButton
|
||||
Flags NoReliefString Right
|
||||
LocaleTitle {Pages:}
|
||||
Font "xft:::pixelsize=15"
|
||||
Colorset 22
|
||||
Value 0
|
||||
Main
|
||||
Case message of
|
||||
SingleClic :
|
||||
Begin
|
||||
SendSignal 4 1
|
||||
End
|
||||
1 :
|
||||
Begin
|
||||
ChangeValue 3 0
|
||||
ChangeValue 4 1
|
||||
ChangeValue 6 $AllPages
|
||||
Set $WorkspacesListValue = (GetValue 5)
|
||||
|
||||
# This block takes care for putting (*) at the end of
|
||||
# Workspaces: label on its radio button when something is
|
||||
# changed from the initial default. Special case is 999
|
||||
# which represents sticky state. There is also procedure
|
||||
# for removing (*) when settings are put back as it was
|
||||
# initially.
|
||||
If $OpMode == 1 Then
|
||||
Begin
|
||||
If $DeskNo == 999 Then
|
||||
Begin
|
||||
Set $InitialDeskNo = $DeskNo
|
||||
End
|
||||
If $StarredWspSet <> 1 Then
|
||||
Begin
|
||||
If $DeskNo <> $InitialDeskNo Then
|
||||
Begin
|
||||
Set $OrigWspTitle = (GetTitle 3)
|
||||
Set $StarredWspTitle = $OrigWspTitle {*}
|
||||
ChangeTitle 3 $StarredWspTitle
|
||||
Set $StarredWspSet = 1
|
||||
End
|
||||
End
|
||||
Else
|
||||
Begin
|
||||
If $DeskNo == $InitialDeskNo Then
|
||||
Begin
|
||||
ChangeTitle 3 $OrigWspTitle
|
||||
Set $StarredWspSet = 0
|
||||
End
|
||||
End
|
||||
End
|
||||
|
||||
# Normal is non-sticky, allpages is sticky
|
||||
# allpages PageNo value is virtual place holder 999
|
||||
# $PagesListValue puts back saved value when changing
|
||||
# mode of operation
|
||||
If $PagesMode == {normal} Then
|
||||
Begin
|
||||
ChangeTitle 5 $Pages
|
||||
|
||||
If $CurrentPageNum == {} Then
|
||||
Begin
|
||||
Set $CurrentPageNumCmd = {$NSCDE_ROOT/bin/mkpagemenu } $PageMatrixX { } $PageMatrixY { pgnum_pgid | grep ' } $PageX { } $PageY {$'}
|
||||
Set $CurrentPageNum = (GetOutput $CurrentPageNumCmd 1 1)
|
||||
ChangeValue 5 $CurrentPageNum
|
||||
End
|
||||
Else
|
||||
Begin
|
||||
If $PagesListValue > 0 Then
|
||||
Begin
|
||||
ChangeValue 5 $PagesListValue
|
||||
End
|
||||
End
|
||||
End
|
||||
Else
|
||||
Begin
|
||||
ChangeValue 6 1
|
||||
Set $PageNo = 999
|
||||
ChangeLocaleTitle 5 { All Pages }
|
||||
ChangeValue 5 1
|
||||
End
|
||||
|
||||
ChangeWindowTitle (Gettext {Occupy Page})
|
||||
ChangeLocaleTitle 6 { All Pages }
|
||||
Set $OpMode = 2
|
||||
End
|
||||
End
|
||||
|
||||
# List of workspaces and/or pages
|
||||
Widget 5
|
||||
Property
|
||||
Size 178 134
|
||||
Position 116 42
|
||||
Type List
|
||||
Flags NoReliefString
|
||||
Title {}
|
||||
Colorset 22
|
||||
Main
|
||||
Case message of
|
||||
SingleClic :
|
||||
Begin
|
||||
If $OpMode == 1 Then
|
||||
Begin
|
||||
# Set DeskNo for further processing
|
||||
Set $DeskNo = (GetValue 5)
|
||||
# Save selected item for putting it back when
|
||||
# mode is changed and then changed back
|
||||
Set $WorkspacesListValue = (GetValue 5)
|
||||
End
|
||||
If $OpMode == 2 Then
|
||||
Begin
|
||||
# Set PageNo for further processing
|
||||
Set $PageNo = (GetValue 5)
|
||||
|
||||
# Set default here if $InitialPageNo was empty
|
||||
# $InitialPageNoSet serves as break
|
||||
If $InitialPageNoSet <> 1 Then
|
||||
Begin
|
||||
Set $InitialPageNo = $CurrentPageNum
|
||||
Set $InitialPageNoSet = 1
|
||||
End
|
||||
|
||||
# Save selected item for putting it back when
|
||||
# mode is changed and then changed back
|
||||
Set $PagesListValue = (GetValue 5)
|
||||
End
|
||||
# Main pick mode
|
||||
If $WinName == {} Then
|
||||
Begin
|
||||
Do {Pick () SendToModule Occupy SendString 1 3 $[w.id]}
|
||||
End
|
||||
End
|
||||
# Dispatcher for Up and Down on the list in workspaces and pages mode
|
||||
1 :
|
||||
Begin
|
||||
If $OpMode == 1 Then
|
||||
Begin
|
||||
SendSignal 5 2
|
||||
End
|
||||
If $OpMode == 2 Then
|
||||
Begin
|
||||
SendSignal 5 3
|
||||
End
|
||||
End
|
||||
# Up and Down on the list in workspaces mode
|
||||
2 :
|
||||
Begin
|
||||
If (LastString) == {Down} Then
|
||||
Begin
|
||||
If (GetValue 5) <= $DesksNo Then
|
||||
Begin
|
||||
Set $NextValue = (Add (GetValue 5) 1)
|
||||
ChangeValue 5 $NextValue
|
||||
Set $DeskNo = $NextValue
|
||||
End
|
||||
Else
|
||||
Begin
|
||||
ChangeValue 5 1
|
||||
Set $DeskNo = 1
|
||||
End
|
||||
End
|
||||
If (LastString) == {Up} Then
|
||||
Begin
|
||||
Set $PrevValue = (Add (GetValue 5) -1)
|
||||
If $PrevValue >= 1 Then
|
||||
Begin
|
||||
ChangeValue 5 $PrevValue
|
||||
Set $DeskNo = $PrevValue
|
||||
End
|
||||
Else
|
||||
Begin
|
||||
Set $MaxDesksNoFromOne = (Add $DesksNo 1)
|
||||
ChangeValue 5 $MaxDesksNoFromOne
|
||||
Set $DeskNo = $MaxDesksNoFromOne
|
||||
End
|
||||
End
|
||||
End
|
||||
# Up and Down on the list in pages mode
|
||||
3 :
|
||||
Begin
|
||||
If (LastString) == {Down} Then
|
||||
Begin
|
||||
If (GetValue 5) <= (Add $PagesNo -1) Then
|
||||
Begin
|
||||
Set $NextValue = (Add (GetValue 5) 1)
|
||||
ChangeValue 5 $NextValue
|
||||
Set $PageNo = $NextValue
|
||||
End
|
||||
Else
|
||||
Begin
|
||||
ChangeValue 5 1
|
||||
Set $PageNo = 1
|
||||
End
|
||||
End
|
||||
If (LastString) == {Up} Then
|
||||
Begin
|
||||
Set $PrevValue = (Add (GetValue 5) -1)
|
||||
If $PrevValue >= 1 Then
|
||||
Begin
|
||||
ChangeValue 5 $PrevValue
|
||||
Set $PageNo = $PrevValue
|
||||
End
|
||||
Else
|
||||
Begin
|
||||
ChangeValue 5 $PagesNo
|
||||
Set $PageNo = $PagesNo
|
||||
End
|
||||
End
|
||||
End
|
||||
End
|
||||
|
||||
# All Workspaces / All Pages stickyness control
|
||||
Widget 6
|
||||
Property
|
||||
Size 100 20
|
||||
Position 116 184
|
||||
Type CheckBox
|
||||
Value 0
|
||||
Flags NoReliefString
|
||||
Title { All Workspaces}
|
||||
Font "xft:::pixelsize=15"
|
||||
Main
|
||||
Case message of
|
||||
SingleClic :
|
||||
Begin
|
||||
SendSignal 6 1
|
||||
End
|
||||
1 :
|
||||
Begin
|
||||
# Keyboard "A" handling
|
||||
# Workspaces mode
|
||||
If $OpMode == 1 Then
|
||||
Begin
|
||||
If (LastString) == {AllToggle} Then
|
||||
Begin
|
||||
If (GetValue 6) == 0 Then
|
||||
Begin
|
||||
Set $AllWorkspaces = 1
|
||||
End
|
||||
Else
|
||||
Begin
|
||||
Set $AllWorkspaces = 0
|
||||
End
|
||||
ChangeValue 6 $AllWorkspaces
|
||||
End
|
||||
|
||||
# Called with click
|
||||
If (GetValue 6) == 1 Then
|
||||
Begin
|
||||
If $WinName == {} Then
|
||||
Begin
|
||||
Do {Pick () SendToModule Occupy SendString 1 3 $[w.id]}
|
||||
End
|
||||
|
||||
# Set DeskNo to 999 for sticky state, save old DeskNo into
|
||||
# OldDeskNo to get it back
|
||||
Set $OldDeskNo = $DeskNo
|
||||
Set $DeskNo = 999
|
||||
ChangeLocaleTitle 5 { All Workspaces}
|
||||
ChangeValue 5 1
|
||||
Set $WorkspacesMode = {allworkspaces}
|
||||
End
|
||||
# Restore workspace states if sticky all workspaces is turned off
|
||||
If (GetValue 6) == 0 Then
|
||||
Begin
|
||||
ChangeTitle 5 $WorkSpaces
|
||||
ChangeValue 5 $OldDeskNo
|
||||
Set $DeskNo = $OldDeskNo
|
||||
Set $WorkspacesMode = {normal}
|
||||
End
|
||||
Set $AllWorkspaces = (GetValue 6)
|
||||
End
|
||||
|
||||
# Keyboard "A" handling
|
||||
# Pages mode
|
||||
If $OpMode == 2 Then
|
||||
Begin
|
||||
If (LastString) == {AllToggle} Then
|
||||
Begin
|
||||
If (GetValue 6) == 0 Then
|
||||
Begin
|
||||
Set $AllPages = 1
|
||||
End
|
||||
Else
|
||||
Begin
|
||||
Set $AllPages = 0
|
||||
End
|
||||
ChangeValue 6 $AllPages
|
||||
End
|
||||
|
||||
# Called with click
|
||||
If (GetValue 6) == 1 Then
|
||||
Begin
|
||||
If $WinName == {} Then
|
||||
Begin
|
||||
Do {Pick () SendToModule Occupy SendString 1 3 $[w.id]}
|
||||
End
|
||||
|
||||
# Set PageNo to 999 for sticky state, save old PageNo into
|
||||
# OldPageNo to get it back
|
||||
Set $OldPageNo = $PageNo
|
||||
Set $PageNo = 999
|
||||
ChangeLocaleTitle 5 { All Pages }
|
||||
ChangeValue 5 1
|
||||
Set $PagesMode = {allpages}
|
||||
End
|
||||
# Restore page states if sticky all workspaces is turned off
|
||||
If (GetValue 6) == 0 Then
|
||||
Begin
|
||||
ChangeTitle 5 $Pages
|
||||
If $OldPageNo <> {} Then
|
||||
Begin
|
||||
ChangeValue 5 $OldPageNo
|
||||
End
|
||||
Else
|
||||
Begin
|
||||
Set $CurrentPageNumCmd = {$NSCDE_ROOT/bin/mkpagemenu } $PageMatrixX { } $PageMatrixY { pgnum_pgid | grep ' } $PageX { } $PageY {$'}
|
||||
Set $CurrentPageNum = (GetOutput $CurrentPageNumCmd 1 1)
|
||||
ChangeValue 5 $CurrentPageNum
|
||||
End
|
||||
Set $PageNo = $OldPageNo
|
||||
Set $PagesMode = {normal}
|
||||
End
|
||||
Set $AllPages = (GetValue 6)
|
||||
End
|
||||
End
|
||||
# Small helpers for accepting internal SendToModule from Init for
|
||||
# sticky states handling
|
||||
2 :
|
||||
Begin
|
||||
Set $WorkspacesMode = {allworkspaces}
|
||||
End
|
||||
3 :
|
||||
Begin
|
||||
Set $PagesMode = {allpages}
|
||||
End
|
||||
End
|
||||
|
||||
# Set "Go with the Window" property for OK button
|
||||
Widget 7
|
||||
Property
|
||||
Size 100 20
|
||||
Position 116 214
|
||||
Type CheckBox
|
||||
Value 0
|
||||
Flags NoReliefString
|
||||
Title { Go with the Window}
|
||||
Font "xft:::pixelsize=15"
|
||||
Main
|
||||
Case message of
|
||||
SingleClic :
|
||||
Begin
|
||||
SendSignal 7 1
|
||||
End
|
||||
1 :
|
||||
Begin
|
||||
Set $GoWithWindow = 1
|
||||
End
|
||||
End
|
||||
|
||||
Widget 8
|
||||
Property
|
||||
Size 298 1
|
||||
Position 2 248
|
||||
Type Rectangle
|
||||
End
|
||||
|
||||
# Main action starter
|
||||
Widget 9
|
||||
Property
|
||||
Size 80 20
|
||||
Position 8 262
|
||||
Type PushButton
|
||||
Flags NoReliefString
|
||||
LocaleTitle {OK}
|
||||
Font "xft:::pixelsize=15"
|
||||
Main
|
||||
Case message of
|
||||
SingleClic :
|
||||
Begin
|
||||
SendSignal 9 1
|
||||
End
|
||||
1 :
|
||||
Begin
|
||||
# If pages are not sticky ...
|
||||
If $PageNo <> 999 Then
|
||||
Begin
|
||||
Set $CurrentPageCmd = {$NSCDE_ROOT/bin/mkpagemenu } $PageMatrixX { } $PageMatrixY { pgnum_pgid | grep '^} $PageNo { '}
|
||||
Set $CurrentPage = (GetOutput $CurrentPageCmd 1 -1)
|
||||
Set $CurrentPageX = (StrCopy $CurrentPage 3 3)
|
||||
Set $CurrentPageY = (StrCopy $CurrentPage 5 5)
|
||||
If $CurrentPageX == { } Then
|
||||
Begin
|
||||
Set $CurrentPageX = (StrCopy $CurrentPage 4 4)
|
||||
End
|
||||
If $CurrentPageY == { } Then
|
||||
Begin
|
||||
Set $CurrentPageY = (StrCopy $CurrentPage 6 6)
|
||||
End
|
||||
|
||||
If $GoWithWindow == 0 Then
|
||||
Begin
|
||||
Do {f_Occupy } $WinId { MoveToPage } $CurrentPageX { } $CurrentPageY { Nop }
|
||||
End
|
||||
Else
|
||||
Begin
|
||||
Do {f_Occupy } $WinId { MoveToPage } $CurrentPageX { } $CurrentPageY { GoToPage }
|
||||
End
|
||||
End
|
||||
|
||||
# If workspaces are not sticky
|
||||
If $DeskNo <> 999 Then
|
||||
Begin
|
||||
If $GoWithWindow == 0 Then
|
||||
Begin
|
||||
Do {f_Occupy } $WinId { MoveToDesk 0 } (Add $DeskNo -1) { Nop }
|
||||
End
|
||||
Else
|
||||
Begin
|
||||
Do {f_Occupy } $WinId { MoveToDesk 0 } (Add $DeskNo -1) { GoToDesk }
|
||||
End
|
||||
End
|
||||
|
||||
# If desks are sticky
|
||||
If $DeskNo == 999 Then
|
||||
Begin
|
||||
Do {WindowId } $WinId { StickAcrossDesks True}
|
||||
End
|
||||
|
||||
# If pages are sticky
|
||||
If $PageNo == 999 Then
|
||||
Begin
|
||||
Do {WindowId } $WinId { StickAcrossPages True}
|
||||
End
|
||||
|
||||
Quit
|
||||
End
|
||||
End
|
||||
|
||||
# Quit button
|
||||
Widget 10
|
||||
Property
|
||||
Size 80 20
|
||||
Position 110 262
|
||||
Type PushButton
|
||||
LocaleTitle {Dismiss}
|
||||
Font "xft:::pixelsize=15"
|
||||
Flags NoReliefString
|
||||
Main
|
||||
Case message of
|
||||
SingleClic :
|
||||
Begin
|
||||
Quit
|
||||
End
|
||||
1 :
|
||||
Begin
|
||||
Set $qstr = (LastString)
|
||||
If $qstr == {Quit} Then
|
||||
Begin
|
||||
Quit
|
||||
End
|
||||
End
|
||||
End
|
||||
|
||||
# Help button
|
||||
Widget 11
|
||||
Property
|
||||
Size 80 20
|
||||
Position 212 262
|
||||
Type PushButton
|
||||
LocaleTitle {Help}
|
||||
Font "xft:::pixelsize=15"
|
||||
Flags NoReliefString
|
||||
Main
|
||||
Case message of
|
||||
SingleClic :
|
||||
Begin
|
||||
SendSignal 11 1
|
||||
End
|
||||
1 :
|
||||
Begin
|
||||
Do {f_DisplayURL "$[gt.Occupy Workspace]" $[NSCDE_ROOT]/share/doc/html/NsCDE-Occupy.html}
|
||||
End
|
||||
End
|
Loading…
Reference in New Issue
Block a user