-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code optimization, fix tooltips, fix threads, better behavior on
realtime configuration changes
- Loading branch information
ItzSelenux
authored and
ItzSelenux
committed
Sep 13, 2024
1 parent
d1169ae
commit ea3ace8
Showing
11 changed files
with
403 additions
and
365 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Continous CI | ||
|
||
permissions: | ||
contents: write | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up variables | ||
id: date | ||
run: | | ||
echo "GH_RELEASE_FILE=gxcapindicator-$(cat VERSION)-$(ldd --version | awk '/ldd/{print "-gnu-" $NF}')" >> $GITHUB_ENV | ||
echo "GH_RELEASE_VERSION=$(cat VERSION)" >> $GITHUB_ENV | ||
- name: Install Dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y \ | ||
build-essential \ | ||
libgtk-3-dev \ | ||
libayatana-appindicator3-dev \ | ||
pkg-config \ | ||
clang | ||
- name: Build with GCC | ||
run: | | ||
make CC=gcc | ||
strip gxcapindicator | ||
mv gxcapindicator ${{ env.GH_RELEASE_FILE }} | ||
- name: Build with Clang | ||
run: | | ||
make CC=clang | ||
continue-on-error: true | ||
|
||
- name: Build with -Werror | ||
run: | | ||
make CFLAGS=-Werror | ||
continue-on-error: true | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
name: Release ci-${{ env.GH_RELEASE_FILE }} | ||
body: ${{ github.event.head_commit.message }} | ||
tag_name: ${{ env.GH_RELEASE_FILE }} | ||
files: | | ||
${{ env.GH_RELEASE_FILE }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
void cancelconfig() | ||
{ | ||
gtk_widget_destroy(dialog); | ||
} | ||
|
||
void on_preferences(GtkWidget *button, gpointer data) | ||
{ | ||
dialog = gtk_window_new(GTK_WINDOW_TOPLEVEL); | ||
gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); | ||
gtk_window_set_title(GTK_WINDOW(dialog), "GXCapIndicator Settings"); | ||
|
||
theme = gtk_icon_theme_get_default(); | ||
info = gtk_icon_theme_lookup_icon(theme, "keyboard-caps-enabled", 48, 0); | ||
if (info != NULL) | ||
{ | ||
icon = gtk_icon_info_load_icon(info, NULL); | ||
gtk_window_set_icon(GTK_WINDOW(dialog), icon); | ||
g_object_unref(icon); | ||
g_object_unref(info); | ||
} | ||
|
||
gtk_container_set_border_width(GTK_CONTAINER(dialog), 5); | ||
|
||
grid = gtk_grid_new(); | ||
gtk_container_add(GTK_CONTAINER(dialog), grid); | ||
gtk_grid_set_column_homogeneous(GTK_GRID(grid), TRUE); | ||
gtk_grid_set_row_homogeneous(GTK_GRID(grid), TRUE); | ||
|
||
gshowcap = gtk_check_button_new(); | ||
gshownum = gtk_check_button_new(); | ||
gupdrate = gtk_entry_new(); | ||
|
||
btn_cancel = gtk_button_new_with_label("cancel"); | ||
btn_savesettings = gtk_button_new_with_label("save"); | ||
|
||
gtk_grid_attach(GTK_GRID(grid), gtk_label_new("Show Caps Lock:"), 0, 0, 1, 1); | ||
gtk_grid_attach(GTK_GRID(grid), gshowcap, 1, 0, 1, 1); | ||
gtk_grid_attach(GTK_GRID(grid), gtk_label_new("Show Num Lock:"), 0, 1, 1, 1); | ||
gtk_grid_attach(GTK_GRID(grid), gshownum, 1, 1, 1, 1); | ||
gtk_grid_attach(GTK_GRID(grid), gtk_label_new("Update rate (seconds):"), 0, 2, 1, 1); | ||
gtk_grid_attach(GTK_GRID(grid), gupdrate, 1, 2, 1, 1); | ||
gtk_grid_attach(GTK_GRID(grid), btn_cancel, 0, 6, 1, 1); | ||
gtk_grid_attach(GTK_GRID(grid), btn_savesettings, 1, 6, 1, 1); | ||
|
||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gshowcap), !!showcap); | ||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gshownum), !!shownum); | ||
|
||
char buffer[32]; | ||
snprintf(buffer, sizeof(buffer), "%d", updrate); | ||
gtk_entry_set_text(GTK_ENTRY(gupdrate), buffer); | ||
|
||
g_signal_connect(btn_cancel, "clicked", G_CALLBACK(cancelconfig), NULL); | ||
g_signal_connect(btn_savesettings, "clicked", G_CALLBACK(saveconfig), dialog); | ||
gtk_widget_show_all(dialog); | ||
gtk_main(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.