Skip to content

Instantly share code, notes, and snippets.

@alaughlin
Created December 26, 2018 17:27
Show Gist options
  • Save alaughlin/f7eac0c88d2939428dcd2ffb67353f1a to your computer and use it in GitHub Desktop.
Save alaughlin/f7eac0c88d2939428dcd2ffb67353f1a to your computer and use it in GitHub Desktop.
config.h
#include <gtk/gtk.h>
/* Login prompt text */
static const char *user_text = "Username";
/* Password prompt text */
static const char *pass_text = "Password";
/* Session name */
static const char *session = "i3";
/* GTK UI CSS */
static const gchar *style =
"window {"
"background-image: url(\"/usr/share/pixmaps/lightdm_bg.jpg\");"
"background=position: center;"
"}"
"window * {"
"font: 14px \"Open Sans\";"
"}"
"#prompt_box {"
"background-color: #6c6c6c;"
"padding: 15px;"
"margin: 50px 650px 50px 650px;"
"}"
"label {"
"color: #f2f2f2;"
"}"
"entry {"
"color: #f2f2f2;"
"background-color: #6c6c6c;"
"box-shadow: none;"
"caret-color: #f2f2f2;"
"}"
"#message_label {"
"color: #e9897c;"
"font-weight: bold;"
"}";
/* GTK UI XML*/
static const gchar *ui =
"<?xml version='1.0' encoding='UTF-8'?>"
"<interface>"
"<requires lib='gtk+' version='3.20'/>"
"<object class='GtkWindow' id='login_window'>"
"<property name='name'>login_window</property>"
"<property name='can_focus'>False</property>"
"<property name='resizable'>False</property>"
"<property name='accept_focus'>False</property>"
"<property name='decorated'>False</property>"
"<child>"
"<placeholder/>"
"</child>"
"<child>"
"<object class='GtkBox' id='login_box'>"
"<property name='name'>login_box</property>"
"<property name='visible'>True</property>"
"<property name='can_focus'>False</property>"
"<property name='valign'>center</property>"
"<property name='vexpand'>True</property>"
"<property name='orientation'>vertical</property>"
"<child>"
"<object class='GtkBox' id='prompt_box'>"
"<property name='name'>prompt_box</property>"
"<property name='visible'>True</property>"
"<property name='can_focus'>False</property>"
"<property name='spacing'>15</property>"
"<property name='homogeneous'>True</property>"
"<child>"
"<object class='GtkLabel' id='prompt_label'>"
"<property name='name'>prompt_label</property>"
"<property name='visible'>True</property>"
"<property name='can_focus'>False</property>"
"<property name='halign'>start</property>"
"</object>"
"<packing>"
"<property name='expand'>False</property>"
"<property name='fill'>True</property>"
"<property name='position'>0</property>"
"</packing>"
"</child>"
"<child>"
"<object class='GtkEntry' id='prompt_entry'>"
"<property name='name'>prompt_entry</property>"
"<property name='visible'>True</property>"
"<property name='can_focus'>True</property>"
"<property name='halign'>end</property>"
"<property name='xalign'>1</property>"
"<property name='has_frame'>False</property>"
"<property name='max_width_chars'>15</property>"
"<property name='primary_icon_activatable'>False</property>"
"<property name='secondary_icon_activatable'>False</property>"
"<signal name='activate' handler='login_cb' swapped='no'/>"
"</object>"
"<packing>"
"<property name='expand'>False</property>"
"<property name='fill'>True</property>"
"<property name='position'>1</property>"
"</packing>"
"</child>"
"</object>"
"<packing>"
"<property name='expand'>False</property>"
"<property name='fill'>True</property>"
"<property name='position'>0</property>"
"</packing>"
"</child>"
"<child>"
"<object class='GtkLabel' id='message_label'>"
"<property name='name'>message_label</property>"
"<property name='visible'>True</property>"
"<property name='can_focus'>False</property>"
"<property name='halign'>center</property>"
"<property name='width_chars'>25</property>"
"<property name='max_width_chars'>50</property>"
"</object>"
"<packing>"
"<property name='expand'>False</property>"
"<property name='fill'>True</property>"
"<property name='position'>1</property>"
"</packing>"
"</child>"
"</object>"
"</child>"
"</object>"
"</interface>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment