File: FvwmBacker.template

package info (click to toggle)
dotfile 1%3A2.4-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 5,472 kB
  • ctags: 523
  • sloc: tcl: 14,072; sh: 918; makefile: 177; lisp: 18; ansic: 7
file content (92 lines) | stat: -rw-r--r-- 3,084 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
### Copyright (C) 1995, 1996, 1997 Jeppe Buk (buk@imada.sdu.dk)
### 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 2 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, write to the Free Software
### Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

proc FvwmBacker {} {
  # Modules / FvwmBacker
  Desc "Configuration of the FvwmBacker module"
  ShortDesc "FvwmBacker"

  Header h -text "FvwmBacker" -frame:relief flat \
      -help "On this page you configure the FvwmBacker module. This"\
      "module is used for having different backgrounds on each virtual desk."
  Line l
  CheckBox spawn -text "Spawn this module when Fvwm2 starts" \
      -help "If you check this option the module will be spawned from"\
      "the two functions 'InitFunction' and 'RestartFunction'. You will"\
      "not have to insert them yourself then."

  Int desk -text "Set background for desk no." -help "Here you specify"\
      "which desktop you wish to configure the background of."
  CheckBox colorB -text "Specify a color"
  Command color \
      -default [list "#000000" 0] \
      -setvalue {
	$widget configure -bg [lindex $color 0] -text "      "} \
      -invoke {ColorWidget $colorList [lindex $color 0] \
		   [lindex $color 1]} \
      -disable {$widget configure -relief flat } \
      -enable {$widget configure -relief raised } \
      -inactive {$widget configure -relief flat -bg black }
  Frame colorF -entries { colorB color }
  CheckBox commandB -text "Specify a command"
  Entry command
  Frame commandF -entries { commandB command }
  ExtEntry backs -entries { desk colorF commandF } -orient top \
      -text "Backgrounds for virtual desks" \
      -index desk

  Change {
    if {$changeElm == "colorB"} {
      if {$colorB == 1} {
	Enable color
	set commandB 0
	Disable command
      } else {
	Disable color
      }
    }
    if {$changeElm == "commandB"} {
      if {$commandB == 1} {
	Enable command
	set colorB 0
	Disable color
      } else {
	Disable command
      }
    }
  }

  PageEnd {
    forevery backs {
      if {$commandB == 1 && $command == ""} {
	error "You must specify a command to set the background"
      } elseif {$desk == "" || $desk < 0} {
	error "Invalid desk no."
      }
    }
  }

  Save {
    forevery backs {
      if {$colorB == 1} {set cmd "-solid [hash2rgb [lindex $color 0]]"
      } else {set cmd $command}
      print "*FvwmBackerDesk $desk $cmd"
    }
    if {$spawn == 1} {
      print "AddToFunc InitFunction \"I\" Module FvwmBacker"
      print "AddToFunc RestartFunction \"I\" Module FvwmBacker"
    }
  }
}