3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #6252 from benley/xbindkeys-config

New package: xbindkeys-config
This commit is contained in:
lethalman 2015-02-09 11:08:08 +01:00
commit e08eb01c05
5 changed files with 169 additions and 0 deletions

View file

@ -28,6 +28,7 @@
bbenoist = "Baptist BENOIST <return_0@live.com>";
bdimcheff = "Brandon Dimcheff <brandon@dimcheff.com>";
bennofs = "Benno Fünfstück <benno.fuenfstueck@gmail.com>";
benley = "Benjamin Staffin <benley@gmail.com>";
berdario = "Dario Bertini <berdario@gmail.com>";
bergey = "Daniel Bergey <bergey@teallabs.org>";
bjg = "Brian Gough <bjg@gnu.org>";

View file

@ -0,0 +1,35 @@
{ stdenv, fetchurl, libX11, gtk, pkgconfig, procps, makeWrapper, ... }:
stdenv.mkDerivation rec {
name = "xbindkeys-config-${version}";
version = "0.1.3";
buildInputs = [ gtk pkgconfig makeWrapper ];
src = fetchurl {
url = "mirror://debian/pool/main/x/xbindkeys-config/xbindkeys-config_${version}.orig.tar.gz";
sha256 = "1rs3li2hyig6cdzvgqlbz0vw6x7rmgr59qd6m0cvrai8xhqqykda";
};
meta = {
homepage = https://packages.debian.org/source/xbindkeys-config;
description = "Graphical interface for configuring xbindkeys";
license = stdenv.lib.licenses.gpl2Plus;
maintainers = with stdenv.lib.maintainers; [benley];
platforms = with stdenv.lib.platforms; linux;
};
patches = [ ./xbindkeys-config-patch1.patch ];
# killall is dangerous on non-gnu platforms. Use pkill instead.
postPatch = ''
substituteInPlace middle.c --replace "killall" "pkill -x"
'';
installPhase = ''
mkdir -p $out/bin $out/share/man/man1
gzip -c ${./xbindkeys-config.1} > $out/share/man/man1/xbindkeys-config.1.gz
cp xbindkeys_config $out/bin/xbindkeys-config
wrapProgram $out/bin/xbindkeys-config --prefix PATH ":" "${procps}/bin"
'';
}

View file

@ -0,0 +1,108 @@
---
Makefile | 6 +++---
menu.c | 11 ++++++++---
middle.c | 9 +++++++--
xbindkeys_config.c | 3 ++-
4 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/Makefile b/Makefile
index 602875c..28e46cd 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,9 @@
# makefile crée par Laurent VUIBERT
-CC= gcc -O3 -Wall
+CC= gcc $(CFLAGS)
STD= _GNU_SOURCE
-GTK= `gtk-config --cflags --libs`
-GTK2= `gtk-config --cflags`
+GTK= `pkg-config --cflags --libs gtk+-2.0`
+GTK2= `pkg-config --cflags gtk+-2.0`
OBJS= xbindkeys_config.o menu.o middle.o speedc.o
NOM= xbindkeys_config
diff --git a/menu.c b/menu.c
index ed3e7ec..f11526d 100644
--- a/menu.c
+++ b/menu.c
@@ -283,6 +283,8 @@ void menu_manual (GtkMenuItem *menuitem, gpointer user_data)
GtkWidget *window;
GtkWidget *text;
GtkWidget *vbox;
+ GtkTextBuffer *textbuffer;
+ GtkTextIter iter;
window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title(GTK_WINDOW(window),
@@ -293,10 +295,13 @@ void menu_manual (GtkMenuItem *menuitem, gpointer user_data)
text = gtk_label_new("\nManual\n");
gtk_box_pack_start(GTK_BOX(vbox), text, FALSE, FALSE, 0);
- text = gtk_text_new(NULL,NULL);
+/* BDD - FIXME */
+/* text = gtk_text_new(NULL,NULL); */
+ text = gtk_text_view_new();
+ textbuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text));
+ gtk_text_buffer_get_iter_at_offset (textbuffer, &iter, 0);
-
- gtk_text_insert (GTK_TEXT(text), NULL, NULL, NULL,
+ gtk_text_buffer_insert (textbuffer, &iter,
MANUAL_TEXT, sizeof(MANUAL_TEXT)-1);
gtk_box_pack_start(GTK_BOX(vbox), text, TRUE, TRUE, 0);
gtk_widget_set_usize(text,300,250);
diff --git a/middle.c b/middle.c
index daa61aa..605ab10 100644
--- a/middle.c
+++ b/middle.c
@@ -551,6 +551,8 @@ void view_generated_file()
GtkWidget *window;
GtkWidget *text;
GtkWidget *src;
+ GtkTextBuffer *textbuffer;
+ GtkTextIter iter;
char line [1024];
unlink(TEMP_FILE);
@@ -561,11 +563,13 @@ void view_generated_file()
gtk_window_set_title(GTK_WINDOW(window), "Generated File");
src = gtk_scrolled_window_new ( NULL, NULL );
gtk_widget_set_usize(src,500,400);
- text = gtk_text_new (NULL, NULL);
+ text = gtk_text_view_new ();
+ textbuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text));
+ gtk_text_buffer_get_iter_at_offset (textbuffer, &iter, 0);
gtk_container_add (GTK_CONTAINER(src), text);
while (fgets (line, sizeof(line), f))
- gtk_text_insert (GTK_TEXT(text), NULL, NULL, NULL,
+ gtk_text_buffer_insert (textbuffer, &iter,
line, strlen(line));
gtk_container_add(GTK_CONTAINER(window),src);
@@ -610,6 +614,7 @@ void save_file(char file_out[])
fprintf(f, "# m:xxx + c:xxx \n");
fprintf(f, "# Shift+... \n\n\n\n\n");
+
if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(Flag_NumLock)))
fprintf(f,"keystate_numlock = enable\n");
else
diff --git a/xbindkeys_config.c b/xbindkeys_config.c
index 75bad30..3c02a2b 100644
--- a/xbindkeys_config.c
+++ b/xbindkeys_config.c
@@ -95,7 +95,8 @@ int main (int argc, char *argv[])
accel_group = gtk_accel_group_new();
menu=xbindkeys_config_menu(accel_group);
gtk_box_pack_start(GTK_BOX(vbox),menu,FALSE,FALSE,0);
- gtk_accel_group_attach(accel_group, GTK_OBJECT(window));
+/* BDD - FIXME - Don't need this? */
+/* gtk_accel_group_attach(accel_group, GTK_OBJECT(window)); */
middle= xbindkeys_config_middle();
gtk_box_pack_start(GTK_BOX(vbox),middle,TRUE,TRUE,0);
--
2.1.3

View file

@ -0,0 +1,21 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.27.
.TH XBINDKEYS_CONFIG "1" "April 2002" "xbindkeys-config" "User Commands"
.SH NAME
xbindkeys-config \- GTK+ configuration tool for xbindkeys
.SH "SYNOPSIS"
xbindkeys-config
[\-\-file|\-f file]
[\-\-help|\-h]
[\-\-show|\-s]
.TP
\fB\-h\fR, \fB\-\-help\fR
This Help
.TP
\fB\-f\fR, \fB\-\-file\fR
Use an alternative rc file
.TP
\fB\-s\fR, \fB\-\-show\fR
show only the rc file
.SH AUTHOR
This manual page was written by Joerg Jaspert <joerg@debian.org>,
for the Debian GNU/Linux system (but may be used by others).

View file

@ -11796,6 +11796,10 @@ let
xbindkeys = callPackage ../tools/X11/xbindkeys { };
xbindkeys-config = callPackage ../tools/X11/xbindkeys-config/default.nix {
gtk = gtk2;
};
xbmcPlain = callPackage ../applications/video/xbmc {
ffmpeg = ffmpeg_1;
};