"Fossies" - the Fresh Open Source Software Archive

Member "xbindkeys-1.8.7/xbindkeys_show" (1 Mar 2020, 2473 Bytes) of package /linux/privat/xbindkeys-1.8.7.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh 
    2 # \
    3 exec wish "$0" "$@"
    4 
    5 
    6 #***************************************************************************
    7 #        XBindKeys_Show : show the keybinding off xbindkeys
    8 #                           -------------------
    9 #    begin                : Sat Oct 13 14:11:34 CEST 2001
   10 #    copyright            : (C) 2001 by Philippe Brochard
   11 #    email                : hocwp@free.fr
   12 #***************************************************************************
   13 #
   14 #***************************************************************************
   15 #*                                                                         *
   16 #*   This program is free software; you can redistribute it and/or modify  *
   17 #*   it under the terms of the GNU General Public License as published by  *
   18 #*   the Free Software Foundation; either version 2 of the License, or     *
   19 #*   (at your option) any later version.                                   *
   20 #*                                                                         *
   21 #***************************************************************************
   22 
   23 set arg0 [ lindex $argv 0 ]
   24 set arg1 [ lindex $argv 1 ]
   25 
   26 if { $arg0 == "--help" || $arg0 == "-h" } {
   27     puts "Usage: xbindkeys_show \[Options\]"
   28     puts "  Where options are:"
   29     puts "         --help                 this help"
   30     puts "     -f, --file <file>          use <file> as configuration file"
   31     puts "    -fg, --file-guile <file>    use <file> as guile configuration file"
   32     exit
   33 }
   34 
   35 
   36 set file_option ""
   37 
   38 if { $arg0 == "--file" || $arg0 == "-f" } {
   39     set file_option "-f"
   40 }
   41 if { $arg0 == "--file-guile" || $arg0 == "-fg" } {
   42     set file_option "-fg"
   43 }
   44 
   45 if { $arg1 != "" && $file_option != "" } {
   46     set list [ exec "xbindkeys" "--show" "$file_option" "$arg1" ]
   47     } else {
   48     set list [ exec "xbindkeys" "--show" ]
   49 }
   50 
   51 
   52 
   53 frame .framelst -borderwidth .5c
   54 pack .framelst -side top -expand yes -fill y
   55 
   56 scrollbar .scroll -command ".liste yview" -orient vertical
   57 scrollbar .scrollx -command ".liste xview" -orient horizontal
   58 listbox .liste -yscroll ".scroll set" -xscroll ".scrollx set" \
   59     -setgrid 1 -height 20 -width 50
   60 
   61 
   62 
   63 
   64 
   65 foreach p [ split $list "\n" ] {
   66     .liste insert end "$p"
   67 }
   68 
   69 button .but0 -text "X key binding\n  for more details see \$HOME/.xbindkeysrc  " \
   70     -command { exit }
   71 
   72 
   73 pack .scroll -in .framelst -side right -fill y
   74 pack .scrollx -in .framelst -side bottom -fill x
   75 pack .liste -in .framelst -side left -expand yes -fill both
   76 
   77 pack .but0 -side bottom
   78 
   79 
   80 bind all <KeyPress> { exit }