--- celestialconfigGOOD.cpp	2007-11-06 14:39:58.000000000 -0600
+++ celestialconfig.cpp	2007-11-10 21:36:51.000000000 -0600
@@ -11,14 +11,8 @@
 string HomeDir;
 char charHomeDir[24];
 static const string Version = "0.0.5";
-WbarIcon Icon1;
-WbarIcon Icon2;
-WbarIcon Icon3;
-WbarIcon Icon4;
-WbarIcon Icon5;
-WbarIcon Icon6;
-WbarIcon Icon7;
-WbarIcon Icon8;
+static vector<WbarIcon*> IconList(0);
+static vector<KeyMod*> KeyModList(0);
 
 Fl_Window *winMain=(Fl_Window *)0;
 
@@ -457,287 +451,238 @@
   Save_Wbar_Stuff();
 }
 
-Fl_Check_Button *chkWbarIconOneEnabled=(Fl_Check_Button *)0;
-
-static void cb_chkWbarIconOneEnabled(Fl_Check_Button*, void*) {
-  char temp[256];
+Fl_Input *txtWbarCommand=(Fl_Input *)0;
 
-if(strcmp(chceWbarIconSelection->value(),"Icon 1") == 0)
+static void cb_txtWbarCommand(Fl_Input*, void*) {
+  for(int i = 0;i < IconList.size();i++)
 {
-	if(chkWbarIconOneEnabled->value() == 1)
-	{
-		Icon1.Enabled = true;
-		stringTOchar(Icon1.Command,&temp[0]);
-		txtWbarCommand->value(temp);
-		stringTOchar(Icon1.Icon,&temp[0]);
-		txtWbarIcon->value(temp);
-	}
-	else
+	string temp = chceWbarIconSelection->value();
+	if(temp == IconList[i]->Name)
 	{
-		Icon1.Enabled = false;
-		txtWbarCommand->value("");
-		txtWbarIcon->value("");
+		IconList[i]->Command = txtWbarCommand->value();
 	}
+};
 }
 
-if(strcmp(chceWbarIconSelection->value(),"Icon 2") == 0)
-{
-	if(chkWbarIconOneEnabled->value() == 1)
-	{
-		Icon2.Enabled = true;
-		stringTOchar(Icon2.Command,&temp[0]);
-		txtWbarCommand->value(temp);
-		stringTOchar(Icon2.Icon,&temp[0]);
-		txtWbarIcon->value(temp);
-	}
-	else
-	{
-		Icon2.Enabled = false;
-		txtWbarCommand->value("");
-		txtWbarIcon->value("");
-	}
-}
+Fl_Input *txtWbarIcon=(Fl_Input *)0;
 
-if(strcmp(chceWbarIconSelection->value(),"Icon 3") == 0)
+static void cb_txtWbarIcon(Fl_Input*, void*) {
+  for(int i = 0;i < IconList.size();i++)
 {
-	if(chkWbarIconOneEnabled->value() == 1)
-	{
-		Icon3.Enabled = true;
-		stringTOchar(Icon3.Command,&temp[0]);
-		txtWbarCommand->value(temp);
-		stringTOchar(Icon3.Icon,&temp[0]);
-		txtWbarIcon->value(temp);
-	}
-	else
+	string temp = chceWbarIconSelection->value();
+	if(temp == IconList[i]->Name)
 	{
-		Icon3.Enabled = false;
-		txtWbarCommand->value("");
-		txtWbarIcon->value("");
+		IconList[i]->Icon = txtWbarIcon->value();
 	}
+};
 }
 
-if(strcmp(chceWbarIconSelection->value(),"Icon 4") == 0)
+Fl_Input_Choice *chceWbarIconSelection=(Fl_Input_Choice *)0;
+
+static void cb_chceWbarIconSelection(Fl_Input_Choice*, void*) {
+  for(int i = 0;i < IconList.size();i++)
 {
-	if(chkWbarIconOneEnabled->value() == 1)
-	{
-		Icon4.Enabled = true;
-		stringTOchar(Icon4.Command,&temp[0]);
-		txtWbarCommand->value(temp);
-		stringTOchar(Icon4.Icon,&temp[0]);
-		txtWbarIcon->value(temp);
-	}
-	else
+	string temp = chceWbarIconSelection->value();
+	if(temp == IconList[i]->Name)
 	{
-		Icon4.Enabled = false;
-		txtWbarCommand->value("");
-		txtWbarIcon->value("");
+		char temp2[256];
+		stringTOchar(IconList[i]->Command,&temp2[0]);
+		txtWbarCommand->value(temp2);
+		stringTOchar(IconList[i]->Icon,&temp2[0]);
+		txtWbarIcon->value(temp2);
 	}
+};
 }
 
-if(strcmp(chceWbarIconSelection->value(),"Icon 5") == 0)
+Fl_Input *txtWbarBackground=(Fl_Input *)0;
+
+Fl_Check_Button *chkWbarEnabled=(Fl_Check_Button *)0;
+
+Fl_Input *txtIconName=(Fl_Input *)0;
+
+Fl_Box *boxDivider=(Fl_Box *)0;
+
+Fl_Button *btnNewIcon=(Fl_Button *)0;
+
+static void cb_btnNewIcon(Fl_Button*, void*) {
+  for(int i = 0;i < IconList.size();i++)
 {
-	if(chkWbarIconOneEnabled->value() == 1)
-	{
-		Icon5.Enabled = true;
-		stringTOchar(Icon5.Command,&temp[0]);
-		txtWbarCommand->value(temp);
-		stringTOchar(Icon5.Icon,&temp[0]);
-		txtWbarIcon->value(temp);
-	}
-	else
+	string name = txtIconName->value();
+	if(name == IconList[i]->Name)
 	{
-		Icon5.Enabled = false;
-		txtWbarCommand->value("");
-		txtWbarIcon->value("");
+		winNewIconError->show();
+		return;
 	}
-};
 }
 
-Fl_Input *txtWbarCommand=(Fl_Input *)0;
 
-static void cb_txtWbarCommand(Fl_Input*, void*) {
-  if(strcmp(chceWbarIconSelection->value(),"Icon 1") == 0)
-{
-	Icon1.Command = txtWbarCommand->value();
-}
+WbarIcon* newIcon = new WbarIcon(txtIconName->value());
 
-if(strcmp(chceWbarIconSelection->value(),"Icon 2") == 0)
-{
-	Icon2.Command = txtWbarCommand->value();
-}
+txtIconName->value("");
 
-if(strcmp(chceWbarIconSelection->value(),"Icon 3") == 0)
-{
-	Icon3.Command = txtWbarCommand->value();
-}
+IconList.push_back(newIcon);
 
-if(strcmp(chceWbarIconSelection->value(),"Icon 4") == 0)
-{
-	Icon4.Command = txtWbarCommand->value();
-}
+chceWbarIconSelection->clear();
 
-if(strcmp(chceWbarIconSelection->value(),"Icon 5") == 0)
+for(int i = 0;i < IconList.size();i++)
 {
-	Icon5.Command = txtWbarCommand->value();
+	char temp[128];
+	stringTOchar(IconList[i]->Name,&temp[0]);
+	chceWbarIconSelection->add(temp);
 };
 }
 
-Fl_Input *txtWbarIcon=(Fl_Input *)0;
+Fl_Button *btnDeleteIcon=(Fl_Button *)0;
 
-static void cb_txtWbarIcon(Fl_Input*, void*) {
-  if(strcmp(chceWbarIconSelection->value(),"Icon 1") == 0)
-{
-	Icon1.Icon = txtWbarIcon->value();
-}
+static void cb_btnDeleteIcon(Fl_Button*, void*) {
+  //DELETE
 
-if(strcmp(chceWbarIconSelection->value(),"Icon 2") == 0)
+for(int i = 0;i < IconList.size();i++)
 {
-	Icon2.Icon = txtWbarIcon->value();
+	string temp = chceWbarIconSelection->value();
+	if(temp == IconList[i]->Name)
+	{
+		IconList.erase(IconList.begin() + i);
+	}
 }
 
-if(strcmp(chceWbarIconSelection->value(),"Icon 3") == 0)
-{
-	Icon3.Icon = txtWbarIcon->value();
-}
+chceWbarIconSelection->clear();
 
-if(strcmp(chceWbarIconSelection->value(),"Icon 4") == 0)
+for(int i = 0;i < IconList.size();i++)
 {
-	Icon4.Icon = txtWbarIcon->value();
+	char temp[128];
+	stringTOchar(IconList[i]->Name,&temp[0]);
+	chceWbarIconSelection->add(temp);
 }
 
-if(strcmp(chceWbarIconSelection->value(),"Icon 5") == 0)
-{
-	Icon5.Icon = txtWbarIcon->value();
-};
+chceWbarIconSelection->value("");
+txtWbarCommand->value("");
+txtWbarIcon->value("");
 }
 
-Fl_Input_Choice *chceWbarIconSelection=(Fl_Input_Choice *)0;
+Fl_Group *grpBackground=(Fl_Group *)0;
 
-static void cb_chceWbarIconSelection(Fl_Input_Choice*, void*) {
-  char temp[256];
+Fl_Button *btnBGSave=(Fl_Button *)0;
 
-if(strcmp(chceWbarIconSelection->value(),"Icon 1") == 0)
-{
-	if(Icon1.Enabled == true)
-	{
-		chkWbarIconOneEnabled->value(1);
-		stringTOchar(Icon1.Icon,&temp[0]);
-		txtWbarIcon->value(temp);
-		stringTOchar(Icon1.Command,&temp[0]);
-		txtWbarCommand->value(temp);
-	}
-	else
-	{
-		chkWbarIconOneEnabled->value(0);
-		txtWbarIcon->value("");
-		txtWbarCommand->value("");
-	}
+static void cb_btnBGSave(Fl_Button*, void*) {
+  WM_Save();
 }
 
-if(strcmp(chceWbarIconSelection->value(),"Icon 2") == 0)
-{
-	if(Icon2.Enabled == true)
-	{
-		chkWbarIconOneEnabled->value(1);
-		stringTOchar(Icon2.Icon,&temp[0]);
-		txtWbarIcon->value(temp);
-		stringTOchar(Icon2.Command,&temp[0]);
-		txtWbarCommand->value(temp);
-	}
-	else
-	{
-		chkWbarIconOneEnabled->value(0);
-		txtWbarIcon->value("");
-		txtWbarCommand->value("");
-	}
-}
+Fl_Input_Choice *chceBGStyle=(Fl_Input_Choice *)0;
 
-if(strcmp(chceWbarIconSelection->value(),"Icon 3") == 0)
+Fl_Input_Choice *chceBGColor=(Fl_Input_Choice *)0;
+
+Fl_Input *txtBGImagePath=(Fl_Input *)0;
+
+Fl_Input_Choice *chceBGImageStyle=(Fl_Input_Choice *)0;
+
+Fl_Group *grpEvilWMRC=(Fl_Group *)0;
+
+Fl_Input_Choice *chceEvilWMRCSelection=(Fl_Input_Choice *)0;
+
+static void cb_chceEvilWMRCSelection(Fl_Input_Choice*, void*) {
+  for(int i = 0;i < KeyModList.size();i++)
 {
-	if(Icon3.Enabled == true)
-	{
-		chkWbarIconOneEnabled->value(1);
-		stringTOchar(Icon3.Icon,&temp[0]);
-		txtWbarIcon->value(temp);
-		stringTOchar(Icon3.Command,&temp[0]);
-		txtWbarCommand->value(temp);
-	}
-	else
+	string temp = chceEvilWMRCSelection->value();
+	if(temp == KeyModList[i]->Name)
 	{
-		chkWbarIconOneEnabled->value(0);
-		txtWbarIcon->value("");
-		txtWbarCommand->value("");
+		spnrKeyCode->value((double)KeyModList[i]->KeyCode);
+		char temp2[256];
+		stringTOchar(KeyModList[i]->Key,&temp2[0]);
+		chceKeyMod->value(temp2);
 	}
+};
 }
 
-if(strcmp(chceWbarIconSelection->value(),"Icon 4") == 0)
+Fl_Spinner *spnrKeyCode=(Fl_Spinner *)0;
+
+static void cb_spnrKeyCode(Fl_Spinner*, void*) {
+  for(int i = 0;i < KeyModList.size();i++)
 {
-	if(Icon4.Enabled == true)
-	{
-		chkWbarIconOneEnabled->value(1);
-		stringTOchar(Icon4.Icon,&temp[0]);
-		txtWbarIcon->value(temp);
-		stringTOchar(Icon4.Command,&temp[0]);
-		txtWbarCommand->value(temp);
-	}
-	else
+	string temp = chceEvilWMRCSelection->value();
+	if(temp == KeyModList[i]->Name)
 	{
-		chkWbarIconOneEnabled->value(0);
-		txtWbarIcon->value("");
-		txtWbarCommand->value("");
+		KeyModList[i]->KeyCode = (int)spnrKeyCode->value();
 	}
+};
 }
 
-if(strcmp(chceWbarIconSelection->value(),"Icon 5") == 0)
+Fl_Button *btnNewKeyMod=(Fl_Button *)0;
+
+static void cb_btnNewKeyMod(Fl_Button*, void*) {
+  for(int i = 0;i < KeyModList.size();i++)
 {
-	if(Icon5.Enabled == true)
-	{
-		chkWbarIconOneEnabled->value(1);
-		stringTOchar(Icon5.Icon,&temp[0]);
-		txtWbarIcon->value(temp);
-		stringTOchar(Icon5.Command,&temp[0]);
-		txtWbarCommand->value(temp);
-	}
-	else
+	string name = txtKBName->value();
+	if(name == KeyModList[i]->Name)
 	{
-		chkWbarIconOneEnabled->value(0);
-		txtWbarIcon->value("");
-		txtWbarCommand->value("");
+		winNewIconError->show();
+		return;
 	}
-};
 }
 
-Fl_Input *txtWbarBackground=(Fl_Input *)0;
 
-Fl_Check_Button *chkWbarEnabled=(Fl_Check_Button *)0;
+KeyMod* newKeyMod = new KeyMod(txtKBName->value());
 
-Fl_Group *grpBackground=(Fl_Group *)0;
+txtKBName->value("");
 
-Fl_Button *btnBGSave=(Fl_Button *)0;
+KeyModList.push_back(newKeyMod);
 
-static void cb_btnBGSave(Fl_Button*, void*) {
-  WM_Save();
+chceEvilWMRCSelection->clear();
+
+for(int i = 0;i < KeyModList.size();i++)
+{
+	char temp[128];
+	stringTOchar(KeyModList[i]->Name,&temp[0]);
+	chceEvilWMRCSelection->add(temp);
+};
 }
 
-Fl_Input_Choice *chceBGStyle=(Fl_Input_Choice *)0;
+Fl_Button *btnDeleteKeyMod=(Fl_Button *)0;
 
-Fl_Input_Choice *chceBGColor=(Fl_Input_Choice *)0;
+static void cb_btnDeleteKeyMod(Fl_Button*, void*) {
+  for(int i = 0;i < KeyModList.size();i++)
+{
+	string temp = chceEvilWMRCSelection->value();
+	if(temp == KeyModList[i]->Name)
+	{
+		KeyModList.erase(KeyModList.begin() + i);
+	}
+}
 
-Fl_Input *txtBGImagePath=(Fl_Input *)0;
+chceEvilWMRCSelection->clear();
 
-Fl_Input_Choice *chceBGImageStyle=(Fl_Input_Choice *)0;
+for(int i = 0;i < KeyModList.size();i++)
+{
+	char temp[128];
+	stringTOchar(KeyModList[i]->Name,&temp[0]);
+	chceEvilWMRCSelection->add(temp);
+}
 
-Fl_Group *grpEvilWMRC=(Fl_Group *)0;
+chceEvilWMRCSelection->value("");
+spnrKeyCode->value(0);
+chceKeyMod->value("");
+}
 
-Fl_Group *grpPackageManagement=(Fl_Group *)0;
+Fl_Button *btnEvilWMRCSave=(Fl_Button *)0;
 
-Fl_Tabs *tabsIpkgInstallRemove=(Fl_Tabs *)0;
+Fl_Input *txtKBName=(Fl_Input *)0;
 
-Fl_Group *grpInstalled=(Fl_Group *)0;
+Fl_Input_Choice *chceKeyMod=(Fl_Input_Choice *)0;
 
-Fl_Group *grpAvailable=(Fl_Group *)0;
+static void cb_chceKeyMod(Fl_Input_Choice*, void*) {
+  for(int i = 0;i < KeyModList.size();i++)
+{
+	string temp = chceEvilWMRCSelection->value();
+	if(temp == KeyModList[i]->Name)
+	{
+		KeyModList[i]->Key = chceKeyMod->value();
+	}
+};
+}
 
-Fl_Group *grpFeedConfig=(Fl_Group *)0;
+Fl_Box *boxQLComingSoon=(Fl_Box *)0;
+
+Fl_Box *boxKeyModsLabel=(Fl_Box *)0;
 
 Fl_Window *winExitX=(Fl_Window *)0;
 
@@ -865,6 +810,16 @@
   winWMSettingsWarning->hide();
 }
 
+Fl_Window *winNewIconError=(Fl_Window *)0;
+
+Fl_Box *boxIconNameWarning=(Fl_Box *)0;
+
+Fl_Button *bthNewIconErrorOK=(Fl_Button *)0;
+
+static void cb_bthNewIconErrorOK(Fl_Button*, void*) {
+  winNewIconError->hide();
+}
+
 Fl_Window* make_window() {
   Fl_Window* w;
   { Fl_Window* o = winMain = new Fl_Window(320, 240, "Celestial Config");
@@ -1017,14 +972,15 @@
             o->end();
           }
           { Fl_Group* o = grpShortcutKeys = new Fl_Group(0, 40, 320, 200, "Shortcut Keys");
-            o->hide();
             o->deactivate();
-            { Fl_Box* o = boxShorcutKeysNotSupported = new Fl_Box(25, 65, 270, 155, "The shortcut keys are not supported at this time.");
+            { Fl_Box* o = boxShorcutKeysNotSupported = new Fl_Box(25, 65, 270, 155, "Please use the \"Config\" section under WM to configure these keys. This is d\
+one to keep .evilwmrc stuff in one place, not just to confuse people.");
               o->align(FL_ALIGN_WRAP);
             }
             o->end();
           }
           { Fl_Group* o = grpSilkscreen = new Fl_Group(0, 40, 320, 200, "Silkscreen");
+            o->hide();
             o->deactivate();
             { Fl_Box* o = boxSilkscreenNotSupported = new Fl_Box(25, 70, 270, 155, "The silkscreen is not supported at this time.");
               o->align(FL_ALIGN_WRAP);
@@ -1089,35 +1045,43 @@
             { Fl_Button* o = btnWbarSave = new Fl_Button(260, 210, 55, 25, "Save");
               o->callback((Fl_Callback*)cb_btnWbarSave);
             }
-            { Fl_Check_Button* o = chkWbarIconOneEnabled = new Fl_Check_Button(180, 50, 135, 25, "Icon Enabled?");
-              o->tooltip("Check this box if you want this icon enabled");
-              o->down_box(FL_DOWN_BOX);
-              o->callback((Fl_Callback*)cb_chkWbarIconOneEnabled);
-              o->when(FL_WHEN_CHANGED);
-            }
-            { Fl_Input* o = txtWbarCommand = new Fl_Input(80, 80, 230, 25, "Command");
+            { Fl_Input* o = txtWbarCommand = new Fl_Input(80, 110, 230, 25, "Command");
               o->tooltip("Enter the command to be executed when this icon is clicked here (Once again, \
 make sure it\'s installed!)");
               o->callback((Fl_Callback*)cb_txtWbarCommand);
               o->when(FL_WHEN_CHANGED);
             }
-            { Fl_Input* o = txtWbarIcon = new Fl_Input(80, 110, 230, 25, "Icon");
+            { Fl_Input* o = txtWbarIcon = new Fl_Input(80, 140, 230, 25, "Icon");
               o->tooltip("Enter the icon to be displayed here");
               o->callback((Fl_Callback*)cb_txtWbarIcon);
               o->when(FL_WHEN_CHANGED);
             }
-            { Fl_Input_Choice* o = chceWbarIconSelection = new Fl_Input_Choice(5, 50, 165, 25);
-              o->tooltip("Select the icon number to edit");
+            { Fl_Input_Choice* o = chceWbarIconSelection = new Fl_Input_Choice(5, 50, 130, 25);
+              o->tooltip("Select the icon to edit");
               o->callback((Fl_Callback*)cb_chceWbarIconSelection);
               o->when(FL_WHEN_CHANGED);
             }
-            { Fl_Input* o = txtWbarBackground = new Fl_Input(95, 160, 215, 25, "Background");
+            { Fl_Input* o = txtWbarBackground = new Fl_Input(95, 180, 215, 25, "Background");
               o->tooltip("Set the launcher panel\'s background here");
             }
             { Fl_Check_Button* o = chkWbarEnabled = new Fl_Check_Button(5, 210, 135, 25, "Enable Wbar?");
               o->tooltip("Uncheck this to disable Wbar");
               o->down_box(FL_DOWN_BOX);
             }
+            { Fl_Input* o = txtIconName = new Fl_Input(185, 50, 130, 25, "Name");
+              o->tooltip("Name for the new icon");
+            }
+            { Fl_Box* o = boxDivider = new Fl_Box(5, 170, 310, 5);
+              o->box(FL_ENGRAVED_FRAME);
+            }
+            { Fl_Button* o = btnNewIcon = new Fl_Button(5, 80, 65, 25, "New");
+              o->tooltip("Creates a new icon with the name given");
+              o->callback((Fl_Callback*)cb_btnNewIcon);
+            }
+            { Fl_Button* o = btnDeleteIcon = new Fl_Button(75, 80, 65, 25, "Delete");
+              o->tooltip("Deletes the selected icon");
+              o->callback((Fl_Callback*)cb_btnDeleteIcon);
+            }
             o->end();
           }
           { Fl_Group* o = grpBackground = new Fl_Group(0, 40, 320, 200, "Background");
@@ -1150,31 +1114,37 @@
           { Fl_Group* o = grpEvilWMRC = new Fl_Group(0, 40, 320, 200, "Config");
             o->tooltip("Configure the .evilwmrc file here.");
             o->hide();
-            o->deactivate();
-            { Fl_Box* o = new Fl_Box(25, 65, 270, 155, "This are will eventually hold the stuff to make .evilwmrc files. For now, rea\
-d the readme in /usr/share/celestial-environment to see how to do them by hand\
-.");
+            { Fl_Input_Choice* o = chceEvilWMRCSelection = new Fl_Input_Choice(5, 75, 130, 25);
+              o->tooltip("Select the evilwmrc entry to edit");
+              o->callback((Fl_Callback*)cb_chceEvilWMRCSelection);
+              o->when(FL_WHEN_CHANGED);
+            }
+            { Fl_Spinner* o = spnrKeyCode = new Fl_Spinner(70, 115, 60, 25, "Keycode");
+              o->tooltip("Select the keycode here (use xev to find them)");
+              o->callback((Fl_Callback*)cb_spnrKeyCode);
+            }
+            { Fl_Button* o = btnNewKeyMod = new Fl_Button(140, 115, 55, 25, "New");
+              o->callback((Fl_Callback*)cb_btnNewKeyMod);
+            }
+            { Fl_Button* o = btnDeleteKeyMod = new Fl_Button(200, 115, 55, 25, "Delete");
+              o->callback((Fl_Callback*)cb_btnDeleteKeyMod);
+            }
+            btnEvilWMRCSave = new Fl_Button(260, 115, 55, 25, "Save");
+            { Fl_Input* o = txtKBName = new Fl_Input(185, 45, 130, 25, "Name");
+              o->tooltip("Enter the name for the custom keybinding here");
+            }
+            { Fl_Input_Choice* o = chceKeyMod = new Fl_Input_Choice(170, 75, 145, 25, "Key");
+              o->tooltip("Change the key to be modified here");
+              o->callback((Fl_Callback*)cb_chceKeyMod);
+              o->when(FL_WHEN_CHANGED);
+            }
+            { Fl_Box* o = boxQLComingSoon = new Fl_Box(5, 145, 310, 5);
+              o->box(FL_ENGRAVED_BOX);
+              o->align(FL_ALIGN_WRAP);
+            }
+            { Fl_Box* o = boxKeyModsLabel = new Fl_Box(5, 45, 125, 25, "Key Mods");
               o->align(FL_ALIGN_WRAP);
             }
-            o->end();
-          }
-          o->end();
-        }
-        o->end();
-      }
-      { Fl_Group* o = grpPackageManagement = new Fl_Group(0, 20, 320, 220, "IPK");
-        o->hide();
-        o->deactivate();
-        { Fl_Tabs* o = tabsIpkgInstallRemove = new Fl_Tabs(0, 20, 320, 220);
-          { Fl_Group* o = grpInstalled = new Fl_Group(0, 40, 320, 200, "Remove");
-            o->end();
-          }
-          { Fl_Group* o = grpAvailable = new Fl_Group(0, 40, 320, 200, "Available");
-            o->hide();
-            o->end();
-          }
-          { Fl_Group* o = grpFeedConfig = new Fl_Group(0, 40, 320, 200, "Configuration");
-            o->hide();
             o->end();
           }
           o->end();
@@ -1231,6 +1201,18 @@
     }
     o->end();
   }
+  { Fl_Window* o = winNewIconError = new Fl_Window(250, 150, "Error!");
+    w = o;
+    { Fl_Box* o = boxIconNameWarning = new Fl_Box(5, 5, 240, 105, "Error: You already have an icon with the name you specified. You must enter a\
+ new name in the name box or delete the old one before this icon can be create\
+d.");
+      o->align(FL_ALIGN_WRAP);
+    }
+    { Fl_Button* o = bthNewIconErrorOK = new Fl_Button(89, 110, 70, 30, "OK");
+      o->callback((Fl_Callback*)cb_bthNewIconErrorOK);
+    }
+    o->end();
+  }
   return w;
 }
 
@@ -1240,14 +1222,7 @@
 	string strTemp = argv[i];
 	if (strTemp == "--help" or strTemp == "-h")
 	{
-		cout << "Usage: celestialconfig [-h][-l]\n\t-l: Loads the config and quits\n\t-h: Shows this help\n";
-		exit(0);
-	}
-	if (strTemp == "-l")
-	{
-		//CODE TO LOAD SETTINGS HERE
-		//Power/BL
-		//BG image (?)
+		cout << "Usage: celestialconfig [-h]\n\t-h: Shows this help\n";
 		exit(0);
 	}
 }
@@ -1258,9 +1233,10 @@
 Set_Up_WM_Stuff();
 Set_Up_Wbar_Stuff();
 Get_Home_Dir();
-update_battery();
+//update_battery();
 Fl::add_timeout(1.0, update_battery_callback);
 winMain->show();
+cout << "OK\n";
 return Fl::run();
 }
 
@@ -1340,7 +1316,7 @@
 chceRightMouse->add("Calendar");
 chceRightMouse->add("Address");
 chceRightMouse->add("Mail");
-chceRightMouse->add("Kanji next to Fn"); //remove
+//chceRightMouse->add("Kanji next to Fn"); //remove
 chceRightMouse->add("Kanji next to -");
 chceRightMouse->add("Right Shift");
 
@@ -1349,7 +1325,7 @@
 chceMiddleMouse->add("Calendar");
 chceMiddleMouse->add("Address");
 chceMiddleMouse->add("Mail");
-chceMiddleMouse->add("Kanji next to Fn"); //remove
+//chceMiddleMouse->add("Kanji next to Fn"); //remove
 chceMiddleMouse->add("Kanji next to -");
 chceMiddleMouse->add("Right Shift");
 
@@ -1424,24 +1400,48 @@
 chceWMTerminal->add("xfce4-terminal");
 chceWMTerminal->add("xterm");
 
+chceKeyMod->add("KEY_TOPLEFT");
+chceKeyMod->add("KEY_TOPRIGHT");
+chceKeyMod->add("KEY_BOTTOMLEFT");
+chceKeyMod->add("KEY_BOTTOMRIGHT");
+chceKeyMod->add("KEY_LEFT");
+chceKeyMod->add("KEY_RIGHT");
+chceKeyMod->add("KEY_UP");
+chceKeyMod->add("KEY_DOWN");
+chceKeyMod->add("KEY_LOWER");
+chceKeyMod->add("KEY_ALTLOWER");
+chceKeyMod->add("KEY_INFO");
+chceKeyMod->add("KEY_MAXVERT");
+chceKeyMod->add("KEY_MAX");
+chceKeyMod->add("KEY_BLUP");
+chceKeyMod->add("KEY_BLDOWN");
+chceKeyMod->add("KEY_DESK1");
+chceKeyMod->add("KEY_DESK2");
+chceKeyMod->add("KEY_DESK3");
+chceKeyMod->add("KEY_DESK4");
+chceKeyMod->add("KEY_DESK5");
+chceKeyMod->add("KEY_DESK6");
+chceKeyMod->add("KEY_DESK7");
+chceKeyMod->add("KEY_DESK8");
+#ifdef VWM
+chceKeyMod->add("KEY_FIX");
+chceKeyMod->add("KEY_PREVDESK");
+chceKeyMod->add("KEY_NEXTDESK");
+#endif
+#ifndef KEY_KILL
+chceKeyMod->add("KEY_KILL");
+#endif
+
 chceWMInactiveColor->value(8);
 chceWMActiveColor->value(5);
 chceWMPinnedColor->value(6);
 chceWMTerminal->value(0);
+chceKeyMod->value(0);
 }
 
 void Set_Up_Wbar_Stuff() {
   //CODE TO LOAD FROM THE CONFIG FILE
 
-chceWbarIconSelection->add("Icon 1");
-chceWbarIconSelection->add("Icon 2");
-chceWbarIconSelection->add("Icon 3");
-chceWbarIconSelection->add("Icon 4");
-chceWbarIconSelection->add("Icon 5");
-
-Icon1.Icon = "/usr/share/pixmaps/gears.png";
-Icon1.Enabled = true;
-Icon1.Command = "celestialconfig";
 
 chkWbarEnabled->value(1);
 
@@ -1453,117 +1453,50 @@
 stringTOchar(HomeDir,&charHomeDir[0]);
 }
 
-/* NONE */ WbarIcon::WbarIcon() {
-  Enabled = false;
-Command = "None";
-Icon = "None";
+/* NONE */ WbarIcon::WbarIcon(string NewName) {
+  Name = NewName;
+Command = "celestialconfig";
+Icon = "/usr/share/pixmaps/gears.png";
 }
 
 /* NONE */ WbarIcon::~WbarIcon() {
 }
 
-void Save_Wbar_Stuff() {
-  ofstream fileout2;
-char charcommand2[256];
-char temp[256];
-
-sprintf(charcommand2,"%s/.wbar\0",charHomeDir);
-fileout2.open(charcommand2);
-
-sprintf(charcommand2,"i: %s\0",txtWbarBackground->value());
-
-
-fileout2 << charcommand2 << endl;
-fileout2 << "c:" << endl;
-fileout2 << "t:" << endl << endl;
-
-if(Icon1.Enabled == true)
-{
-	stringTOchar(Icon1.Icon,&temp[0]);
-	sprintf(charcommand2,"i: %s\0", temp);
-	fileout2 << charcommand2 << endl;
-	stringTOchar(Icon1.Command,&temp[0]);
-	sprintf(charcommand2,"c: %s\0", temp);
-	fileout2 << charcommand2 << endl;
-	fileout2 << "t:" << endl << endl;
-}
-
-if(Icon2.Enabled == true)
-{
-	stringTOchar(Icon2.Icon,&temp[0]);
-	sprintf(charcommand2,"i: %s\0", temp);
-	fileout2 << charcommand2 << endl;
-	stringTOchar(Icon2.Command,&temp[0]);
-	sprintf(charcommand2,"c: %s\0", temp);
-	fileout2 << charcommand2 << endl;
-	fileout2 << "t:" << endl << endl;
+/* NONE */ KeyMod::KeyMod(string NewName) {
+  Name = NewName;
+KeyCode = (int)spnrKeyCode->value();
+Key = "NONE";
 }
 
-if(Icon3.Enabled == true)
-{
-	stringTOchar(Icon3.Icon,&temp[0]);
-	sprintf(charcommand2,"i: %s\0", temp);
-	fileout2 << charcommand2 << endl;
-	stringTOchar(Icon3.Command,&temp[0]);
-	sprintf(charcommand2,"c: %s\0", temp);
-	fileout2 << charcommand2 << endl;
-	fileout2 << "t:" << endl << endl;
+/* NONE */ KeyMod::~KeyMod() {
 }
 
-if(Icon4.Enabled == true)
+void Save_Wbar_Stuff() {
+  if(chkWbarEnabled->value() == 1)
 {
-	stringTOchar(Icon4.Icon,&temp[0]);
-	sprintf(charcommand2,"i: %s\0", temp);
-	fileout2 << charcommand2 << endl;
-	stringTOchar(Icon4.Command,&temp[0]);
-	sprintf(charcommand2,"c: %s\0", temp);
-	fileout2 << charcommand2 << endl;
-	fileout2 << "t:" << endl << endl;
-}
+	ofstream fileout2;
+	char charcommand2[256];
+	char temp[256];
 
-if(Icon5.Enabled == true)
-{
-	stringTOchar(Icon5.Icon,&temp[0]);
-	sprintf(charcommand2,"i: %s\0", temp);
-	fileout2 << charcommand2 << endl;
-	stringTOchar(Icon5.Command,&temp[0]);
-	sprintf(charcommand2,"c: %s\0", temp);
-	fileout2 << charcommand2 << endl;
-	fileout2 << "t:" << endl << endl;
-}
+	sprintf(charcommand2,"%s/.wbar\0",charHomeDir);
+	fileout2.open(charcommand2);
 
-if(Icon6.Enabled == true)
-{
-	stringTOchar(Icon6.Icon,&temp[0]);
-	sprintf(charcommand2,"i: %s\0", temp);
-	fileout2 << charcommand2 << endl;
-	stringTOchar(Icon6.Command,&temp[0]);
-	sprintf(charcommand2,"c: %s\0", temp);
-	fileout2 << charcommand2 << endl;
-	fileout2 << "t:" << endl << endl;
-}
+	sprintf(charcommand2,"i: %s\0",txtWbarBackground->value());
 
-if(Icon7.Enabled == true)
-{
-	stringTOchar(Icon7.Icon,&temp[0]);
-	sprintf(charcommand2,"i: %s\0", temp);
-	fileout2 << charcommand2 << endl;
-	stringTOchar(Icon7.Command,&temp[0]);
-	sprintf(charcommand2,"c: %s\0", temp);
-	fileout2 << charcommand2 << endl;
-	fileout2 << "t:" << endl << endl;
-}
 
-if(Icon8.Enabled == true)
-{
-	stringTOchar(Icon8.Icon,&temp[0]);
-	sprintf(charcommand2,"i: %s\0", temp);
-	fileout2 << charcommand2 << endl;
-	stringTOchar(Icon8.Command,&temp[0]);
-	sprintf(charcommand2,"c: %s\0", temp);
 	fileout2 << charcommand2 << endl;
+	fileout2 << "c:" << endl;
 	fileout2 << "t:" << endl << endl;
+	
+	for(int i = 0;i < IconList.size();i++)
+	{
+		stringTOchar(IconList[i]->Icon,&temp[0]);
+		sprintf(charcommand2,"i: %s\0", temp);
+		fileout2 << charcommand2 << endl;
+		stringTOchar(IconList[i]->Command,&temp[0]);
+		sprintf(charcommand2,"c: %s\0", temp);
+		fileout2 << charcommand2 << endl;
+		fileout2 << "t:" << endl << endl;
+	}
 }
-
-fileout2.close();
 }
