Initial commit

This commit is contained in:
Mid Favila 2021-03-06 13:17:27 -04:00
parent b1b4102bfc
commit c30eac9c0e
28 changed files with 2770 additions and 3 deletions

1
.fvwm2rc Symbolic link
View File

@ -0,0 +1 @@
mainrc

9
NEWS Normal file
View File

@ -0,0 +1,9 @@
6/2/2021: Initial git push to SDF. Split logic and assets.
1/2/2021: Cosmetics engine partially implemented, resolution independent
GUI partially implemented, batman improved. Github repo coming soon.
11/1/2021: README is updated, NEWS is created. This will serve as an
overview of what and when things change, and any plans for the future.

29
README Normal file
View File

@ -0,0 +1,29 @@
####################################################################
## Favila's X Desktop Environment ##
####################################################################
Hello! Thanks for trying out my FVWM configuration. Included in this
repo is all of my scripts and dotfiles, laid out in self explanatory
format (for the most part).
I've tried to keep the dotfiles readable and the overall system clean,
but this is the first "large" project I've ever worked on, so it might
be a little (or a lot) bit messy.
I recommend you use the following software if you want an experience
with minimal tinkering out of the box;
*xset for triggering screen locking
*xssstart for automatically locking the screen
*slock (or your preferred screen locker...)
*scrot, for screenshot functionality
*stalonetray, for the shelf's tray
*libxpm, for rendering window decorations
*xcompmgr, for lightweight and simple compositing (optional)
*xclock, for the system clock
*xosview, for system monitors
*xcalendar, for a lightweight scheduling system
Any rights to the assets that are distributed with this tarball or
recommended for use are reserved by their original authors. If you
like them, please support their work.

View File

@ -1,3 +0,0 @@
# fxde-core
The base configuration for my FVWM setup. Includes core modules, logic, and functionality.

View File

@ -0,0 +1,38 @@
Colorset N | Meaning | Usage Examples
-----------+----------------------------+-------------------------------------
0 | default | feedback windows, FvwmScroll
1 | inactive window | window/icon titles, windows in Pager
2 | active window | window/icon titles, windows in Pager
3 | inactive borders | window borders (may copy 1)
4 | active borders | window borders (may copy 2)
5 | inactive menu item | menus (may have pixmap or gradient)
6 | active menu item | menus (only bg/fg used)
7 | greyed menu item | menus (only fg used)
9 | modules, default | Button Bar, Pager, other modules
10 | modules, default hilight | Button Bar
11 | modules, special | gradient for IconMan/IconBox
12 | modules, swallowed apps | bg, fg, sh, hi for xclock/xload etc.
13 | modules, default #2 | alternative for Pager, Button Bar
14 | modules, default hilight #2| alternative for Pager
15 | modules, balloons | TaskBar, Pager
16 | modules, winlist, standard | item of IconMan, WinList, TaskBar
17 | modules, winlist, active | --.--
18 | modules, winlist, iconified| --.--
19 | modules, winlist, pointed | --.--
20 | modules, ident | FvwmIdent
21 | modules, console | FvwmConsole
22 | modules, transparent | Button Bar
23 | regular terminal | xterm/rxvt or any other terminal
24 | admin terminal | terminal for root (su)
25 | remote terminal | terminal with ssh/rsh/telnet
26 | viewer terminal | man, less, tail -f
27 | console application | top, editor
28 | dialog main area | FvwmScript, FvwmForm, xmessage
29 | dialog text area | FvwmScript, FvwmForm, xmessage
30-40 | Reserved for use as needed | Anything

78
docs/Goals Normal file
View File

@ -0,0 +1,78 @@
Goals for the next release
·> Provide a simple graphical utility for persistent configuration
·> Add an initial configuration dialog that runs on first start
·> Further modularization of the design (and make the grouping more consistent) [IN PROGRESS]
·> Proper code style (indentation, etc) [SO FAR SO GOOD]
·> Attempt to reduce depedence on external programs further, where possible [IN PROGRESS]
·> Increase portability through the use of "which" when executing programs [USING IF [ -x ] INSTEAD]
·> Refine the aesthetic [LOOKING GOOD SO FAR]
·> Implement a proper mechanism for switching themes on the fly [LOOKING GOOD SO FAR - PAPE WORKS]
·> FIX THE UI SCALING ISSUES!!! [SHOULD BE WORKING - TEST]
·> Implement rudimentary keyboard-based window management including tiling
·> Dialog system to replace XMessage?
·> Try to write a POSIX script to generate automatic menus, instead of using
XDG Menu Maker. Requiring Python for a lightweight "DE" is stupid.
[EDIT] Scheme would be better for this
·> Write a script for automating the process of theme creation? Would be nice.
Maybe try to use Scheme for this.
·> Write wrapper scripts using FvwmButtons for MPV, FFPlay, MPlayer, etc that
otherwise can't open on their own. Maybe implement a file-chooser and such?
·> Convert all included graphics to png, to reduce library requirements.
·> Attempt to make features useable with other tools, like
ImageMagick's "import" instead of scrot [LOOKING GOOD SO FAR]
·> Use POSIX shell for simple calculations, and Scheme for more complex tasks
such as generating program lists [LOOKING GOOD SO FAR]
·> Write a screenshot function and add wide-area or specific-area flags to
Hunter
·> Write the "Waiter" script in Scheme, to automatically generate valid FVWM
menus using the XDG specification.
Overall structure will be the following
mainrc
/ | \
/ | \
.prefs infra/ modules/
/ | | |
/ progs/ * *
assets |
/ | \ *
widgets audio colors
main will read the preferences file, which will tell it what colorset,
soundfont, and widgets to load from assets (plus stuff like wallpaper).
it will also be responsible for reading in the preferred programs,
listed under the progs directory.
main will then read in all files under the infra/ directory; this will
be responsible for defining the functions, window management, and misc
details of the inner workings of things. they will be broken up by category;
windrc for window management, funcrc for functions, menurc for menus, cosmrc
for cosmetics (i.e the assignment of colors and widgets to objects)
lastly, main will read in all relevant modules; at a bare minimum, this
includes the Shelf, the Taskbar, and the Command modules. It will also
execute the StartFunction and DaemonFunction, to initialize FXDE.

5
infra/cosmrc Normal file
View File

@ -0,0 +1,5 @@
# Set the standard font for elements.
Style * Font $[infostore.std_font]
# Load theme settings.
Read $[infostore.theme]

75
infra/funcrc Normal file
View File

@ -0,0 +1,75 @@
# Test function. You shouldn't be seeing this.
DestroyFunc TestScrotFunc
AddToFunc TestScrotFunc
+ I Exec exec $[infostore.posix]/hunter -g
# Load and restore preferences.
DestroyFunc PrefFunc
AddToFunc PrefFunc
+ I Read $[FVWM_USERDIR]/.data/prefrc
+ I Function PaperBoy $[infostore.papedir]/$[infostore.pape]
# Start daemons.
DestroyFunc DaemonFunc
AddToFunc DaemonFunc
+ I Exec exec $[infostore.compositor]
+ I Exec exec /usr/bin/xssstart $[infostore.locker]
+ I Exec exec $[infostore.notifs]
+ I Exec exec $[infostore.posix]/batman
+ I Exec exec emacs --daemon
# Spawn modules and whatnot.
AddToFunc ModuleFunc
+ I Module FvwmEvent AudioEvents
+ I Module FvwmButtons TaskBar
+ I Schedule 5 Module FvwmButtons Shelf
+ I Schedule 10 Module FvwmPager ShelfPager
# Define how to handle task switching.
DestroyFunc TaskSwitchFunc
AddToFunc TaskSwitchFunc
+ I Iconify off
+ I Focus
+ I Raise
+ I WarpToWindow !raise 5 5
# Define the "Show Desktop" feature
DestroyFunc ShowDeskFunc
AddToFunc ShowDeskFunc
+ I All (CurrentDesk, Iconic, State 1) HideDeskFunc
+ I TestRc (Match) Break
+ I All (CurrentDesk, !Iconic, !State 1) ThisWindow State 1 True
+ I All (CurrentDesk, !Iconic, State 1) Iconify
DestroyFunc HideDeskFunc
AddToFunc HideDeskFunc
+ I All (CurrentDesk, Iconic, State 1) Iconify off
+ I All (CurrentDesk, State1) ThisWindow State 1 False
# Remove widgets and set window dimensions to the size of the screen minus the
# UI elements. This simulates "full screen" without covering stuff.
DestroyFunc LargeifyFunc
AddToFunc LargeifyFunc
+ I PipeRead ""
# A simple function to set the wallpaper.
DestroyFunc PaperBoy
AddToFunc PaperBoy
+ I InfoStoreAdd pape /home/midfavila/.config/fvwm/.data/prefs/cosmetics/pape
+ I Exec exec $[infostore.posix]/paperboy $[infostore.papedir]/`cat $[infostore.pape]`

31
infra/kbindrc Normal file
View File

@ -0,0 +1,31 @@
# Ignore num/caps/scroll lock
IgnoreModifiers L25
# Disable the root menu
Mouse 1 R A
# Bind the session manager and execute dialog
Key Delete A CM Module FvwmScript $[infostore.fscript]/FvwmScript-ConfirmQuit
Key Return A C Module FvwmScript $[infostore.fscript]/FvwmScript-Execute
# Program shortcuts
Key T A CM Exec exec $[infostore.term]
Key E A CM Exec exec $[infostore.editor]
Key F A CM Exec exec $[infostore.filer]
Key B A CM Exec exec $[infostore.lbrowse]
Key M A CM Exec exec $[infostore.mail]
Key N A CM Exec exec $[infostore.news]
Key I A CM Exec exec $[infostore.im]
Key C A CM Exec exec $[infostore.calc]
# Shortcut for killing stuff
Key Q A CM Close
# Window focus
Key Tab A M Next (CurrentDesk, AcceptsFocus) FocusFunc
Key Tab A SM Prev (CurrentDesk, AcceptsFocus) FocusFunc
# Maximize
Key F11 A A Maximize

72
infra/menurc Normal file
View File

@ -0,0 +1,72 @@
# The first section of the document defines the look and feel of menus.
MenuStyle * PopupDelayed, PopupDelay 300, PopupAsSubmenu, HoldSubmenus \
PopupOffset 1 100, PopdownImmediately,
# The second section describes their contents.
DestroyMenu WindowOps
AddToMenu WindowOps "$[gt. Window Operations ]" Title
+ "Iconify" Iconify
+ "Maximize" Maximize
+ "" Nop
+ "Close" Close
+ "Kill" Destroy
+ "" Nop
+ "Scrape" Exec exec $[infostore.posix]/hunter -s
DestroyMenu EditMenu
AddToMenu EditMenu "$[gt. Editors ]" Title
+ "Docs" Exec exec $[infostore.deditor]
+ "IDE" Exec exec $[infostore.ide]
+ "Text" Exec exec $[infostore.editor]
DestroyMenu BrowseMenu
AddToMenu BrowseMenu "$[gt. Browsers ]" Title
+ "Full" Exec exec $[infostore.fbrowse]
+ "Lite" Exec exec $[infostore.lbrowse]
DestroyMenu CommsMenu
AddToMenu CommsMenu "$[gt. Comms ]" Title
+ "Mail" Exec exec $[infostore.mail]
+ "News" Exec exec $[infostore.news]
+ "IM" Exec exec $[infostore.im]
DestroyMenu MediaMenu
AddToMenu MediaMenu "$[gt. Media ]" Title
+ "Video Player" Exec exec $[infostore.vplay]
+ "Music Player" Exec exec $[infostore.mplay]
+ "Image Viewer" Exec exec $[infostore.iview]
+ "Image Editor" Exec exec $[infostore.iedit]
DestroyMenu UtilMenu
AddToMenu UtilMenu "$[gt. Utilities ]"
+ "Calculator" Exec exec $[infostore.calc]
+ "Doc Viewer" Exec exec $[infostore.dview]
+ "Torrents" Exec exec $[infostore.torrent]
+ "" Nop
+ "Screenshot" Exec exec $[infostore.posix]/hunter -g
+ "Identify" Module FvwmIdent
+ "" Nop
+ "Manual" Exec exec $[infostore.man]
DestroyMenu InfoMenu
AddToMenu InfoMenu "$[gt. Sysinfo ]"
+ "Task Manager" Exec exec $[infostore.pmon]
+ "Systems Check" Module FvwmScript $[infostore.fscript]/FXDE-SystemsCheck

6
infra/varrc Normal file
View File

@ -0,0 +1,6 @@
# Define variables via infostore.
InfoStoreAdd posix $[FVWM_USERDIR]/scripts/posix
InfoStoreAdd fscript $[FVWM_USERDIR]/scripts/fvwmscript
InfoStoreAdd sdir $[FVWM_USERDIR]/assets/audio
InfoStoreAdd papedir $[FVWM_USERDIR]/assets/wallpaper

19
infra/windrc Normal file
View File

@ -0,0 +1,19 @@
# Define how to handle windows in general.
EwmhBaseStruts 0 136 32 0
ClickTime 250
MoveThreshold 2
Style * SloppyFocus
Style * TileCascadePlacement
# Define how to handle system windows
Style Session GrabFocus,WindowListSkip,StaysOnTop,Sticky,PositionPlacement Center
Style Run... GrabFocus,WindowListSkip,StaysOnTop,Sticky,PositionPlacement Center
# Define how to handle application windows
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

25
mainrc Normal file
View File

@ -0,0 +1,25 @@
# StartFunction executes every time FVWM executes.
# Load in necessary data.
Read modules/shelf
Read modules/taskbar
Read modules/pager
Read modules/events
Read .data/prefrc
Read infra/funcrc
Read infra/varrc
Read infra/cosmrc
Read infra/kbindrc
Read infra/menurc
Read infra/windrc
DestroyFunc StartFunction
AddToFunc StartFunction
+ I Exec exec $[infostore.posix]/janitor
+ I Function PrefFunc
+ I Function ModuleFunc
+ I Schedule 250 Function DaemonFunc

13
modules/events Normal file
View File

@ -0,0 +1,13 @@
DestroyModuleConf AudioEvents
*AudioEvents: Cmd "Exec exec /usr/bin/aplay"
*AudioEvents: StartDelay 2.5
*AudioEvents: startup $[FVWM_USERDIR]/assets/audio/Login.wav
*AudioEvents: shutdown $[FVWM_USERDIR]/assets/audio/Logout.wav
*AudioEvents: unknown $[FVWM_USERDIR]/assets/audio/Chirp.wav
*AudioEvents: destroy_window $[FVWM_USERDIR]/assets/audio/WindowDestroyed.wav
*AudioEvents: error $[FVWM_USERDIR]/assets/audio/BadNotif.wav
*AudioEvents: add_window $[FVWM_USERDIR]/assets/audio/MenuOpen.wav
*AudioEvents: windowshade $[FVWM_USERDIR]/assets/audio/WindowShaded.wav
*AudioEvents: dewindowshade $[FVWM_USERDIR]/assets/audio/WindowUnshaded.wav

12
modules/pager Normal file
View File

@ -0,0 +1,12 @@
Style "ShelfPager" NoTitle, !Handles, !Borders, Sticky, WindowListSkip, \
CirculateSkip, StaysOnBottom, FixedPosition, FixedSize, !Iconifiable
DestroyModuleConfig ShelfPager
*ShelfPager: Geometry 100+100
*ShelfPager: Font "xft:Cozette:Medium:Roman:size=8"
*ShelfPager: Rows 1
*ShelfPager: Columns 1
*ShelfPager: Colorset * 9
*ShelfPager: HilightColorset * 10
*ShelfPager: WindowColorsets 13 14
*ShelfPager: SolidSeparators

62
modules/shelf Normal file
View File

@ -0,0 +1,62 @@
#Define the shelf.
Style "Shelf" NoTitle, !Handles, !Borders, Sticky, WindowListSkip, \
CirculateSkip, StaysOnBottom, FixedPosition, FixedSize, !Iconifiable, NeverFocus
DestroyModuleConfig Shelf
*Shelf: Geometry 136x$[vp.height]-0-0@g
*Shelf: Columns 136
*Shelf: Rows $[vp.height]
*Shelf: Frame 2
*Shelf: Padding 2 2
*Shelf: Colorset 10
*Shelf: BoxSize fixed
*Shelf: Font $[infostore.font_ui]
*Shelf: Colorset 9
*Shelf: PressColorset 10
# Columns are X, rows are Y
*Shelf: (Size 5x$[vp.height])
*Shelf: (Size 131x5, ActiveColorset 10, PressColorset 10)
*Shelf: (Size 131x30, Title (Right) Terminal, Action Exec exec $[infostore.term]
*Shelf: (Size 131x30, Title (Right) Editors , Action Menu EditMenu)
*Shelf: (Size 131x30, Title (Right) Files , Action Exec exec $[infostore.filer])
*Shelf: (Size 131x30, Title (Right) Browsers , Action Menu BrowseMenu)
*Shelf: (Size 131x30, Title (Right) Comms , Action Menu CommsMenu)
*Shelf: (Size 131x30, Title (Right) Media , Action Menu MediaMenu)
*Shelf: (Size 131x30, Title (Right) Utilities , Action Menu UtilMenu)
*Shelf: (Size 131x15, Frame 0)
*Shelf: (Size 131x30, Title (Right) Run , Action Module FvwmScript $[infostore.fscript]/FvwmScript-Execute)
*Shelf: (Size 131x30, Title (Right) Configure , Action Module FvwmScript $[infostore.fscript]/FXDE-ControlPanel)
*Shelf: (Size 131x30, Title (Right) Sysinfo , Action Menu InfoMenu)
*Shelf: (Size 131x30, Title (Right) Hide , Action Function ShowDeskFunc)
*Shelf: (Size 131x30, Title (Right) Lock , Action Exec exec xset s activate)
*Shelf: (Size 131x30, Title (Right) Logout , Action Module FvwmScript $[infostore.fscript]/FvwmScript-ConfirmQuit)
#PipeRead 'echo "*Shelf: (Size 131x$(((($[vp.height]/53)*10)))), Frame 0)"'
#*Shelf: (Size 64x64, Frame 0, Swallow wmifs, 'Exec exec wmifs', Frame 1)
#*Shelf: (Size 64x64, Frame 0, Swallow wmix, 'Exec exec wmix', Frame 1)
#*Shelf: (Size 64x64, Frame 0, Swallow wmmon, 'Exec exec wmmon -l', Frame 1)
#*Shelf: (Size 64x64, Frame 0, Swallow wmmon, 'Exec exec wmmon -l -s -b', Frame 1)
#*Shelf: (Size 64x64, Frame 0, Swallow wmcalc, 'Exec exec wmcalc', Frame 1)
#*Shelf: (Size 64x64, Frame 0, Swallow wmmoonclock, 'Exec exec wmmoonclock', Frame 1)
PipeRead 'echo "*Shelf: (Size 131x$(((($[vp.height]/53)*6)))), Frame 0, Swallow xosview" ", \'Exec exec xosview\')"'
PipeRead 'echo "*Shelf: (Size 131x$(((($[vp.height]/53)*5)))), Frame 0)"'
*Shelf: (Size 131x60, Frame 0, Swallow stalonetray, 'Exec exec stalonetray --kludges force_icons_size --icon-size 32 --icon-gravity SE --geometry 4x2 --background "#BEBEBE"')
*Shelf: (Size 131x5, Frame 0)
*Shelf: (Action Exec exec xcalendar, Size 131x30, Frame 0, Swallow xclock, 'Exec exec /usr/bin/xclock -digital -strftime "%a %H:%M:%S" -update 1 -bg "#BEBEBE" -sharp -face "xft:Cozette:Medium:Roman:size=13"')
*Shelf: (Size 131x130, Frame 0, Swallow ShelfPager)

53
modules/taskbar Normal file
View File

@ -0,0 +1,53 @@
# Define the taskbar.
DestroyModuleConfig TaskBar
Style "TaskBar" NoTitle, !Handles, !Borders, Sticky, WindowListSkip, \
CirculateSkip, StaysOnBottom, FixedPosition, FixedSize, \
!Iconifiable, NeverFocus
*TaskBarButtons: Font "xft:Cozette:Medium:Roman:size=8"
PipeRead 'echo "*TaskBar: Geometry $(($[vp.width]-136))x32-136@g)"'
*TaskBar: Columns $[vp.width]
*TaskBar: Rows 32
*TaskBar: Frame 0
*TaskBar: Colorset 9
# Swallow the buttonbar.
*TaskBar: (Size $[vp.width]x28, Swallow TaskBarButtons 'Module FvwmIconMan TaskBarButtons')'"
# Define the buttonbar.
DestroyModuleConfig TaskBarButtons
*TaskBarButtons: UseWinList true
*TaskBarButtons: Resolution page
*TaskBarButtons: Tips needed
*TaskBarButtons: ButtonGeometry 125x26
*TaskBarButtons: MaxButtonWidth $[vp.width]
*TaskBarButtons: ManagerGeometry 1x1+100+0@g
*TaskBarButtons: DrawIcons always
*TaskBarButtons: ReliefThickness 2
*TaskBarButtons: IconButton down
*TaskBarButtons: IconAndSelectButton down
*TaskBarButtons: SelectButton up
*TaskBarButtons: Colorset 16
*TaskBarButtons: FocusAndSelectColorset 17
*TaskBarButtons: Shape true
# Button actions.
*TaskBarButtons: Action Mouse 1 A sendcommand Iconify
*TaskBarButtons: Action Mouse 3 A sendcommand "Menu WindowOps Mouse 0 o100"
# Button logic.
*TaskBarButtons: Sort id
# Provide a simple bevel effect.
*TaskBar: (Size $[vp.width]x4, Frame 2)

View File

@ -0,0 +1,207 @@
WindowTitle {Session}
WindowSize 375 185
Colorset 10
Init
Begin
End
Widget 1
Property
Title {Please select an option.}
Size 200 30
Position 75 10
Type ItemDraw
Flags NoReliefString NoFocus
Main
Case message of
SingleClic :
Begin
End
End
Widget 2
Property
Title {}
Size 0 0
Position 115 55
Flags NoReliefString
Colorset 10
Type RadioButton
Value 1
Main
Case message of
SingleClic :
Begin
ChangeValue 2 1
ChangeValue 3 0
ChangeValue 4 0
ChangeValue 5 0
End
End
Widget 3
Property
Title {}
Size 0 0
Position 115 75
Flags NoReliefString
Colorset 15
Type RadioButton
Value 0
Main
Case message of
SingleClic :
Begin
ChangeValue 2 0
ChangeValue 3 1
ChangeValue 4 0
ChangeValue 5 0
End
End
Widget 4
Property
Title {}
Size 0 0
Position 115 95
Flags NoReliefString
Colorset 15
Type RadioButton
Value 0
Main
Case message of
SingleClic :
Begin
ChangeValue 2 0
ChangeValue 3 0
ChangeValue 4 1
ChangeValue 5 0
End
End
Widget 5
Property
Title {}
Size 0 0
Position 115 115
Flags NoReliefString
Colorset 15
Type RadioButton
Value 0
Main
Case message of
SingleClic :
Begin
ChangeValue 2 0
ChangeValue 3 0
ChangeValue 4 0
ChangeValue 5 1
End
End
Widget 6
Property
Title {Cancel}
Size 71 28
Position 285 140
Flags NoReliefString
Colorset 12
Type PushButton
Main
Case message of
SingleClic :
Begin
Quit
End
End
Widget 20
Property
Title {Restart FXDE Session}
Size 100 15
Position 130 54
Flags NoReliefString
Colorset 0
Type ItemDraw
End
Widget 30
Property
Title {Halt FXDE Session}
Size 100 15
Position 130 74
Flags NoReliefString
Colorset 0
Type ItemDraw
End
Widget 40
Property
Title {Restart System}
Size 100 15
Position 130 94
Flags NoReliefString
Colorset 0
Type ItemDraw
End
Widget 50
Property
Title {Halt System}
Size 80 15
Position 130 114
Flags NoReliefString
Colorset 0
Type ItemDraw
End
Widget 7
Property
Title {Ok}
Size 71 28
Colorset 12
Position 215 140
Flags NoReliefString
Type PushButton
Main
Case message of
SingleClic :
Begin
If (GetValue 2) == 1 Then
Begin
Do {Restart}
Quit
End
Else
Begin
If (GetValue 3) == 1 Then
Begin
Do {Quit}
Quit
End
Else
Begin
If (GetValue 4) == 1 Then
Begin
Do {Exec exec /bin/sls /bin/reboot}
Quit
End
Else
Begin
If (GetValue 5) == 1 Then
Begin
Do {Exec exec /bin/sls /bin/shutdown}
Quit
End
End
End
End
End

View File

@ -0,0 +1,34 @@
WindowTitle {Run...}
WindowSize 512 64
Widget 1
Property
Title {}
Size 496 24
Position 8 4
Flags NoReliefString
Type TextField
Value 1
Main
Case message of
SingleClic :
Begin
End
End
Widget 2
Property
Size 70 18
Position 410 35
Flags NoReliefString
Type PushButton
Title {Execute...}
Main
Case message of
SingleClic :
Begin
Do {Exec exec sh -c '} (GetTitle 1) {' &}
Quit
End
End

View File

@ -0,0 +1,799 @@
#
# 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

View File

@ -0,0 +1,541 @@
WindowLocaleTitle {Workstation Information}
WindowSize 486 352
Font "xft::Regular:pixelsize=12"
Colorset 22
Init
Begin
Key Escape A 36 1 {Quit}
Key Return A 36 1 {Quit}
Set $WidgetFont = (GetOutput {} 1 -1)
ChangeFont 36 $WidgetFont
ChangeFont 1 $TextFont
ChangeFont 2 $TextFont
ChangeFont 3 $TextFont
ChangeFont 4 $TextFont
ChangeFont 5 $TextFont
ChangeFont 6 $TextFont
ChangeFont 7 $TextFont
ChangeFont 8 $TextFont
ChangeFont 9 $TextFont
ChangeFont 10 $TextFont
ChangeFont 11 $TextFont
ChangeFont 12 $TextFont
ChangeFont 13 $TextFont
ChangeFont 14 $TextFont
ChangeFont 19 $TextFont
ChangeFont 20 $TextFont
ChangeFont 21 $TextFont
ChangeFont 22 $TextFont
ChangeFont 23 $TextFont
ChangeFont 24 $TextFont
ChangeFont 25 $TextFont
ChangeFont 26 $TextFont
ChangeFont 27 $TextFont
ChangeFont 28 $TextFont
ChangeFont 29 $TextFont
ChangeFont 30 $TextFont
ChangeFont 31 $TextFont
ChangeFont 32 $TextFont
ChangeFont 33 $TextFont
ChangeFont 34 $TextFont
Set $username = { } (GetOutput {id -un} 1 -1)
Set $hostname = { } (GetOutput {uname -n} 1 1)
Set $machtype = { } (GetOutput {uname -mpi} 1 -1)
Set $ipaddr = { } (GetOutput {$NSCDE_ROOT/bin/sysinfo.py} 4 -1)
Set $hostid = { } (GetOutput {hostid} 1 -1)
Set $domainname = { } (GetOutput {domainname} 1 -1)
Set $inetdomain = { } (GetOutput {$NSCDE_ROOT/bin/sysinfo.py} 5 -1)
Set $mem = { } (GetOutput {$HOME/.fvwm/scripts/posix/memmb} 0 -1) { MB}
Set $mempct = { } (GetOutput {$HOME/.fvwm/scripts/posix/memusemb} 0 -1)
Set $swapinfo = { } (GetOutput {$HOME/.fvwm/scripts/posix/memfree} 0 -1) {MB Available}
Set $swap = { } (GetOutput {$HOME/.fvwm/scripts/posix/swapmb} 0 -1) { MB}
Set $swappct = { } (GetOutput {$HOME/.fvwm/scripts/posix/} 0 -1)
Set $swapinfo = { } (GetOutput {$HOME/.fvwm/scripts/posix/swapfree} 0 -1) { MB Available}
Set $sysname = (GetOutput {uname -s} 1 -1)
Set $osname = (GetOutput {uname -o} 1 -1)
Set $osver = (GetOutput {uname -r} 1 -1)
Set $sysstring = { } $sysname { Release } $osver { } $osname
Set $winmgr = { } (GetOutput {fvwm -version} 1 -1)
If $sysname == {Linux} Then
Begin
Set $lastboot = { } (GetOutput {x=`uptime | cut -b 17` ; y=`uptime | cut -b 19,20` ; printf "$x hours and $y minutes\n"} 1 -1)
End
Else
Begin
Set $lastboot = { Not available/displayed on } $sysname
End
ChangeTitle 21 $username
ChangeTitle 22 $hostname
ChangeTitle 23 $machtype
ChangeTitle 24 $ipaddr
ChangeTitle 25 $hostid
ChangeTitle 26 $domainname
ChangeTitle 27 $inetdomain
ChangeTitle 28 $mem
ChangeTitle 29 $swap
ChangeTitle 30 $swapinfo
ChangeTitle 31 $sysstring
ChangeTitle 32 $winmgr
ChangeTitle 33 $nscdever
ChangeTitle 34 $lastboot
ChangeValue 20 $swappct
End
Widget 1
Property
Size 150 0
Position 10 15
Type ItemDraw
Flags NoReliefString Right
LocaleTitle {User Name:}
Main
Case message of
SingleClic :
Begin
End
End
Widget 21
Property
Size 100 0
Position 159 15
Type ItemDraw
Flags NoReliefString Left
Title {<username>}
Main
Case message of
SingleClic :
Begin
End
End
Widget 2
Property
Size 150 0
Position 10 32
Type ItemDraw
Flags NoReliefString Right
LocaleTitle {Workstation Name:}
Main
Case message of
SingleClic :
Begin
End
End
Widget 22
Property
Size 100 0
Position 159 32
Type ItemDraw
Flags NoReliefString Left
Title {<hostname>}
Main
Case message of
SingleClic :
Begin
End
End
Widget 3
Property
Size 150 0
Position 10 48
Type ItemDraw
Flags NoReliefString Right
LocaleTitle {Type:}
Main
Case message of
SingleClic :
Begin
End
End
Widget 23
Property
Size 100 0
Position 159 48
Type ItemDraw
Flags NoReliefString Left
Title {<machtype>}
Main
Case message of
SingleClic :
Begin
End
End
Widget 4
Property
Size 150 0
Position 10 77
Type ItemDraw
Flags NoReliefString Right
LocaleTitle {Internet (IP) Address:}
Main
Case message of
SingleClic :
Begin
End
End
Widget 24
Property
Size 100 0
Position 159 77
Type ItemDraw
Flags NoReliefString Left
Title {<ipaddr>}
Main
Case message of
SingleClic :
Begin
End
End
Widget 5
Property
Size 150 0
Position 10 94
Type ItemDraw
Flags NoReliefString Right
LocaleTitle {Host ID:}
Main
Case message of
SingleClic :
Begin
End
End
Widget 25
Property
Size 100 0
Position 159 94
Type ItemDraw
Flags NoReliefString Left
Title {<hostid>}
Main
Case message of
SingleClic :
Begin
End
End
Widget 6
Property
Size 150 0
Position 10 110
Type ItemDraw
Flags NoReliefString Right
LocaleTitle {Network Domain:}
Main
Case message of
SingleClic :
Begin
End
End
Widget 26
Property
Size 100 0
Position 159 110
Type ItemDraw
Flags NoReliefString Left
Title {<domainname>}
Main
Case message of
SingleClic :
Begin
End
End
Widget 7
Property
Size 150 0
Position 10 128
Type ItemDraw
Flags NoReliefString Right
LocaleTitle {Internet Domain:}
Main
Case message of
SingleClic :
Begin
End
End
Widget 27
Property
Size 200 0
Position 159 128
Type ItemDraw
Flags NoReliefString Left
Title {<domain>}
Main
Case message of
SingleClic :
Begin
End
End
Widget 8
Property
Size 154 0
Position 6 162
Type ItemDraw
Flags NoReliefString Right
LocaleTitle {Physical Memory (RAM):}
Main
Case message of
SingleClic :
Begin
End
End
Widget 28
Property
Size 200 0
Position 159 162
Type ItemDraw
Flags NoReliefString Left
Title {<mem>}
Main
Case message of
SingleClic :
Begin
End
End
Widget 9
Property
Size 150 0
Position 6 179
Type ItemDraw
Flags NoReliefString Right
LocaleTitle {Virtual Memory (Swap):}
Main
Case message of
SingleClic :
Begin
End
End
Widget 29
Property
Size 200 0
Position 159 179
Type ItemDraw
Flags NoReliefString Left
Title {<swap>}
Main
Case message of
SingleClic :
Begin
End
End
Widget 10
Property
Size 150 0
Position 10 196
Type ItemDraw
Flags NoReliefString Right
LocaleTitle {Virtual Memory in Use:}
Main
Case message of
SingleClic :
Begin
End
End
Widget 30
Property
Size 256 0
Position 264 196
Type ItemDraw
Flags NoReliefString Left
Title {<swapused>}
Main
Case message of
SingleClic :
Begin
End
End
Widget 20
Property
Position 166 198
Type HDipstick
Size 102 16
Title {}
MinValue 0
MaxValue 100
Value 1
Colorset 3
Main
Case message of
SingleClic :
Begin
End
End
Widget 11
Property
Size 150 0
Position 10 220
Type ItemDraw
Flags NoReliefString Right
LocaleTitle {Operating System:}
Main
Case message of
SingleClic :
Begin
End
End
Widget 31
Property
Size 324 0
Position 159 220
Type ItemDraw
Flags NoReliefString Left
Title {<sysstring>}
Main
Case message of
SingleClic :
Begin
End
End
Widget 12
Property
Size 150 0
Position 10 238
Type ItemDraw
Flags NoReliefString Right
LocaleTitle {Window Manager:}
Main
Case message of
SingleClic :
Begin
End
End
Widget 32
Property
Size 314 0
Position 159 238
Type ItemDraw
Flags NoReliefString Left
Title {<winmgr>}
Main
Case message of
SingleClic :
Begin
End
End
Widget 13
Property
Size 150 0
Position 10 256
Type ItemDraw
Flags NoReliefString Right
LocaleTitle { }
Main
Case message of
SingleClic :
Begin
End
End
Widget 33
Property
Size 256 0
Position 159 256
Type ItemDraw
Flags NoReliefString Left
Title {<nscdever>}
Main
Case message of
SingleClic :
Begin
End
End
Widget 14
Property
Size 150 0
Position 10 284
Type ItemDraw
Flags NoReliefString Right
LocaleTitle {System Uptime:}
Main
Case message of
SingleClic :
Begin
End
End
Widget 34
Property
Size 256 0
Position 159 284
Type ItemDraw
Flags NoReliefString Left
Title {<lastboot>}
Main
Case message of
SingleClic :
Begin
End
End
Widget 36
Property
Size 72 0
Position 204 312
Type PushButton
LocaleTitle {Dismiss}
Flags NoReliefString
Main
Case message of
SingleClic :
Begin
SendSignal 36 1
End
1 :
Begin
Quit
End
End
Widget 19
Property
Size 48 48
Position 300 8
Type ItemDraw
Flags NoReliefString Left
Title {}
Icon CDE/SDtsysinfo.m.pm
Main
Case message of
SingleClic :
Begin
End
End

View File

@ -0,0 +1,545 @@
WindowLocaleTitle {Workstation Information}
WindowSize 486 352
Font "xft::Regular:pixelsize=12"
Colorset 22
Init
Begin
Key Escape A 36 1 {Quit}
Key Return A 36 1 {Quit}
Set $WidgetFont = (GetOutput {$NSCDE_ROOT/bin/getfont -v -t normal -s medium -Z 11} 1 -1)
ChangeFont 36 $WidgetFont
Set $TextFont = (GetOutput {$NSCDE_ROOT/bin/getfont -v -t normal -s small -Z 10} 1 -1)
ChangeFont 1 $TextFont
ChangeFont 2 $TextFont
ChangeFont 3 $TextFont
ChangeFont 4 $TextFont
ChangeFont 5 $TextFont
ChangeFont 6 $TextFont
ChangeFont 7 $TextFont
ChangeFont 8 $TextFont
ChangeFont 9 $TextFont
ChangeFont 10 $TextFont
ChangeFont 11 $TextFont
ChangeFont 12 $TextFont
ChangeFont 13 $TextFont
ChangeFont 14 $TextFont
ChangeFont 19 $TextFont
ChangeFont 20 $TextFont
ChangeFont 21 $TextFont
ChangeFont 22 $TextFont
ChangeFont 23 $TextFont
ChangeFont 24 $TextFont
ChangeFont 25 $TextFont
ChangeFont 26 $TextFont
ChangeFont 27 $TextFont
ChangeFont 28 $TextFont
ChangeFont 29 $TextFont
ChangeFont 30 $TextFont
ChangeFont 31 $TextFont
ChangeFont 32 $TextFont
ChangeFont 33 $TextFont
ChangeFont 34 $TextFont
Set $username = { } (GetOutput {id -un} 1 -1)
Set $hostname = { } (GetOutput {uname -n} 1 1)
Set $machtype = { } (GetOutput {uname -mpi} 1 -1)
Set $ipaddr = { } (GetOutput {$NSCDE_ROOT/bin/sysinfo.py} 4 -1)
Set $hostid = { } (GetOutput {hostid} 1 -1)
Set $domainname = { } (GetOutput {domainname} 1 -1)
Set $inetdomain = { } (GetOutput {$NSCDE_ROOT/bin/sysinfo.py} 5 -1)
Set $mem = { } (GetOutput {$HOME/.fvwm/scripts/posix/memmb} 0 -1) { MB}
Set $mempct = { } (GetOutput {$HOME/.fvwm/scripts/posix/memusemb} 0 -1)
Set $swapinfo = { } (GetOutput {$HOME/.fvwm/scripts/posix/memfree} 0 -1) {MB Available}
Set $swap = { } (GetOutput {$HOME/.fvwm/scripts/posix/swapmb} 0 -1) { MB}
Set $swappct = { } (GetOutput {$HOME/.fvwm/scripts/posix/} 0 -1)
Set $swapinfo = { } (GetOutput {$HOME/.fvwm/scripts/posix/swapfree} 0 -1) { MB Available}
Set $sysname = (GetOutput {uname -s} 1 -1)
Set $osname = (GetOutput {uname -o} 1 -1)
Set $osver = (GetOutput {uname -r} 1 -1)
Set $sysstring = { } $sysname { Release } $osver { } $osname
Set $winmgr = { } (GetOutput {fvwm -version} 1 -1)
If $sysname == {Linux} Then
Begin
Set $lastboot = { } (GetOutput {uptime | cut -b 1,2,3,4,5,6,7,8,9,10} 1 -1)
End
Else
Begin
Set $lastboot = { Not available/displayed on } $sysname
End
ChangeTitle 21 $username
ChangeTitle 22 $hostname
ChangeTitle 23 $machtype
ChangeTitle 24 $ipaddr
ChangeTitle 25 $hostid
ChangeTitle 26 $domainname
ChangeTitle 27 $inetdomain
ChangeTitle 28 $mem
ChangeTitle 29 $swap
ChangeTitle 30 $swapinfo
ChangeTitle 31 $sysstring
ChangeTitle 32 $winmgr
ChangeTitle 33 $nscdever
ChangeTitle 34 $lastboot
ChangeValue 20 $swappct
End
Widget 1
Property
Size 150 0
Position 10 15
Type ItemDraw
Flags NoReliefString Right
LocaleTitle {User Name:}
Main
Case message of
SingleClic :
Begin
End
End
Widget 21
Property
Size 100 0
Position 159 15
Type ItemDraw
Flags NoReliefString Left
Title {<username>}
Main
Case message of
SingleClic :
Begin
End
End
Widget 2
Property
Size 150 0
Position 10 32
Type ItemDraw
Flags NoReliefString Right
LocaleTitle {Workstation Name:}
Main
Case message of
SingleClic :
Begin
End
End
Widget 22
Property
Size 100 0
Position 159 32
Type ItemDraw
Flags NoReliefString Left
Title {<hostname>}
Main
Case message of
SingleClic :
Begin
End
End
Widget 3
Property
Size 150 0
Position 10 48
Type ItemDraw
Flags NoReliefString Right
LocaleTitle {Type:}
Main
Case message of
SingleClic :
Begin
End
End
Widget 23
Property
Size 100 0
Position 159 48
Type ItemDraw
Flags NoReliefString Left
Title {<machtype>}
Main
Case message of
SingleClic :
Begin
End
End
Widget 4
Property
Size 150 0
Position 10 77
Type ItemDraw
Flags NoReliefString Right
LocaleTitle {Internet (IP) Address:}
Main
Case message of
SingleClic :
Begin
End
End
Widget 24
Property
Size 100 0
Position 159 77
Type ItemDraw
Flags NoReliefString Left
Title {<ipaddr>}
Main
Case message of
SingleClic :
Begin
End
End
Widget 5
Property
Size 150 0
Position 10 94
Type ItemDraw
Flags NoReliefString Right
LocaleTitle {Host ID:}
Main
Case message of
SingleClic :
Begin
End
End
Widget 25
Property
Size 100 0
Position 159 94
Type ItemDraw
Flags NoReliefString Left
Title {<hostid>}
Main
Case message of
SingleClic :
Begin
End
End
Widget 6
Property
Size 150 0
Position 10 110
Type ItemDraw
Flags NoReliefString Right
LocaleTitle {Network Domain:}
Main
Case message of
SingleClic :
Begin
End
End
Widget 26
Property
Size 100 0
Position 159 110
Type ItemDraw
Flags NoReliefString Left
Title {<domainname>}
Main
Case message of
SingleClic :
Begin
End
End
Widget 7
Property
Size 150 0
Position 10 128
Type ItemDraw
Flags NoReliefString Right
LocaleTitle {Internet Domain:}
Main
Case message of
SingleClic :
Begin
End
End
Widget 27
Property
Size 200 0
Position 159 128
Type ItemDraw
Flags NoReliefString Left
Title {<domain>}
Main
Case message of
SingleClic :
Begin
End
End
Widget 8
Property
Size 154 0
Position 6 162
Type ItemDraw
Flags NoReliefString Right
LocaleTitle {Physical Memory (RAM):}
Main
Case message of
SingleClic :
Begin
End
End
Widget 28
Property
Size 200 0
Position 159 162
Type ItemDraw
Flags NoReliefString Left
Title {<mem>}
Main
Case message of
SingleClic :
Begin
End
End
Widget 9
Property
Size 150 0
Position 6 179
Type ItemDraw
Flags NoReliefString Right
LocaleTitle {Virtual Memory (Swap):}
Main
Case message of
SingleClic :
Begin
End
End
Widget 29
Property
Size 200 0
Position 159 179
Type ItemDraw
Flags NoReliefString Left
Title {<swap>}
Main
Case message of
SingleClic :
Begin
End
End
Widget 10
Property
Size 150 0
Position 10 196
Type ItemDraw
Flags NoReliefString Right
LocaleTitle {Virtual Memory in Use:}
Main
Case message of
SingleClic :
Begin
End
End
Widget 30
Property
Size 256 0
Position 264 196
Type ItemDraw
Flags NoReliefString Left
Title {<swapused>}
Main
Case message of
SingleClic :
Begin
End
End
Widget 20
Property
Position 166 198
Type HDipstick
Size 102 16
Title {}
MinValue 0
MaxValue 100
Value 50
Colorset 2
Main
Case message of
SingleClic :
Begin
End
End
Widget 11
Property
Size 150 0
Position 10 220
Type ItemDraw
Flags NoReliefString Right
LocaleTitle {Operating System:}
Main
Case message of
SingleClic :
Begin
End
End
Widget 31
Property
Size 324 0
Position 159 220
Type ItemDraw
Flags NoReliefString Left
Title {<sysstring>}
Main
Case message of
SingleClic :
Begin
End
End
Widget 12
Property
Size 150 0
Position 10 238
Type ItemDraw
Flags NoReliefString Right
LocaleTitle {Window Manager:}
Main
Case message of
SingleClic :
Begin
End
End
Widget 32
Property
Size 314 0
Position 159 238
Type ItemDraw
Flags NoReliefString Left
Title {<winmgr>}
Main
Case message of
SingleClic :
Begin
End
End
Widget 13
Property
Size 150 0
Position 10 256
Type ItemDraw
Flags NoReliefString Right
LocaleTitle { }
Main
Case message of
SingleClic :
Begin
End
End
Widget 33
Property
Size 256 0
Position 159 256
Type ItemDraw
Flags NoReliefString Left
Title {<nscdever>}
Main
Case message of
SingleClic :
Begin
End
End
Widget 14
Property
Size 150 0
Position 10 284
Type ItemDraw
Flags NoReliefString Right
LocaleTitle {System Uptime:}
Main
Case message of
SingleClic :
Begin
End
End
Widget 34
Property
Size 256 0
Position 159 284
Type ItemDraw
Flags NoReliefString Left
Title {<lastboot>}
Main
Case message of
SingleClic :
Begin
End
End
Widget 36
Property
Size 72 0
Position 204 312
Type PushButton
LocaleTitle {Dismiss}
Flags NoReliefString
Main
Case message of
SingleClic :
Begin
SendSignal 36 1
End
1 :
Begin
Quit
End
2 :
Begin
Do {f_DisplayURL "Sysinfo" $[NSCDE_ROOT]/share/doc/html/NsCDE-SysInfo.html}
End
End
Widget 19
Property
Size 48 48
Position 300 8
Type ItemDraw
Flags NoReliefString Left
Title {}
Icon CDE/SDtsysinfo.m.pm
Main
Case message of
SingleClic :
Begin
End
End

23
scripts/posix/bach Executable file
View File

@ -0,0 +1,23 @@
#!/bin/sh -e
if [ $# -le 1 ]
then
printf "This script will take two variables and convert all audio files of the first format to the second, using ffmpeg. \n"
elif [ $# -ge 3 ]
then
printf "You've entered too many variables. We only need two... did you not check the help? \n"
else
i=`ls | grep $1 | wc -l`
p=1
mkdir $2
while [ $p -le $i ]
do
x=`ls | sed "$p!d"`
y=`printf "$x" | sed "s/$1/$2/"`
yes | ffmpeg -i "$x" "$y"
mv "$y" $2/
p=$(( $p + 1 ))
done
fi

10
scripts/posix/batman Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
while true
do sleep 60
x=`cat /sys/class/power_supply/BAT1/capacity`
while [ $x -le 25 ]
do aplay $FVWM_USERDIR/sounds/CritNotif.wav &
printf "Battery alert!\nYour battery only has a remaining capacity of $x!" | xmessage -file - -center
done
done

50
scripts/posix/hunter Executable file
View File

@ -0,0 +1,50 @@
# Hunter is a simple tool that will take a screenshot of a specific window
# using existing tools on the system, ordered from most to least efficient.
# For now I only know how to implement this with scrot... import soon:tm:!
# How to check for our tools.
csearch()
if [ -x /usr/bin/scrot ]
then export cap=scrot
elif [ -x /usr/bin/import
then export cap=import
fi
vsearch()
if [ -x /usr/bin/feh ]
then export view=feh
elif [ -x /usr/bin/gpicview ]
then export view=gpicview
fi
# Gather our tools.
csearch
vsearch
case "$1" in
-g)
if [ $cap = scrot ]
then exec $cap -d 1 -e "exec $view /tmp/$f" /tmp/scrot.png
fi
;;
-s)
if [ $cap = scrot ]
then exec $cap -n -d 1 -u -e "exec $view /tmp/$f" /tmp/scrot.png
fi
;;
-t)
printf "$cap\n"
printf "$view\n"
;;
*)
printf "Hunter is a tool to take both window specific and non-specific screenshots using pre-existing utilities. Hunter accepts the following options:\n\n -g: Shoot the entire screen.\n -s: Shoot a specific window.\n -t: Print the tools Hunter is using.\n"
;;
esac

9
scripts/posix/janitor Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh -e
for junk in xssstart xcompmgr batman
do ps -e | grep -ie $junk | awk '{printf "kill -9 " $1 "\n"}' | sh -e -- &
done
#ps -e | grep -ie xssstart | awk '{printf "kill -9 " $1 "\n"}' | sh -e -- &
#ps -e | grep -ie xcompmgr | awk '{printf "kill -9 " $1 "\n"}' | sh -e -- &
#ps -e | grep -ie batman | awk '{printf "kill -9 " $1 "\n"}' | sh -e -- &

11
scripts/posix/paperboy Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh -e
# A simple script to set the wallpaper using existing tools.
# Sorted in order of efficiency.
if [ $# != 1 ]
then printf "Paperboy is a simple script that will automatically detect and use existing tools to set your wallpaper.\n"
elif [ -x /usr/bin/xwallpaper ]
then xwallpaper --no-randr --stretch $1
elif [ -x /usr/bin/feh ]
then feh --no-fehbg --bg-scale $1
fi

13
scripts/posix/weatherman Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh -e
if [ $# -ne 1 ]
then
printf "This script will return weather and time information for the entered METAR station. \n"
else
curl -s https://tgftp.nws.noaa.gov/data/observations/metar/decoded/$1.TXT > /tmp/$1.in.tmp
sed 2q /tmp/$1.in.tmp > /tmp/$1.out.tmp
grep Sky /tmp/$1.in.tmp >> /tmp/$1.out.tmp
grep Temperature /tmp/$1.in.tmp | cut -b 1,2,3,4,5,6,7,8,9,10,11,12,13,20,21,22,23 >> /tmp/cyfc.out.tmp
grep Humidity /tmp/$1.in.tmp >> /tmp/$1.out.tmp
more /tmp/$1.out.tmp
fi