initial commit

This commit is contained in:
2020-08-04 23:09:05 -04:00
commit fecee5afab
55 changed files with 2784 additions and 0 deletions

17
data/dbus/meson.build Normal file
View File

@@ -0,0 +1,17 @@
dbus_config_data = configuration_data()
dbus_config_data.set('LIBEXEC_DIR', join_paths(get_option('prefix'), get_option('libexecdir'), meson.project_name()))
dbus_config_data_file = configure_file(
input: 'org.tuf.manager.server.service.in',
output: 'org.tuf.manager.server.service',
configuration: dbus_config_data
)
install_data(
['org.tuf.manager.server.conf'],
install_dir: join_paths(get_option('datadir'), 'dbus-1', 'system.d')
)
install_data(
dbus_config_data_file,
install_dir: join_paths(get_option('datadir'), 'dbus-1', 'system-services')
)

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<!-- Only root can own the service -->
<policy user="root">
<allow own="org.tuf.manager.server"/>
</policy>
<!-- Allow anyone to invoke methods on the interfaces -->
<policy context="default">
<allow send_destination="org.tuf.manager.server"
send_interface="org.tuf.manager.server"/>
<allow send_destination="org.tuf.manager.server"
send_interface="org.freedesktop.DBus.Introspectable"/>
<allow send_destination="org.tuf.manager.server"
send_interface="org.freedesktop.DBus.Peer"/>
<allow send_destination="org.tuf.manager.server"
send_interface="org.freedesktop.DBus.Properties"/>
</policy>
</busconfig>

View File

@@ -0,0 +1,4 @@
[D-BUS Service]
Name=org.tuf.manager.server
Exec=@LIBEXEC_DIR@/tuf-server
User=root

12
data/gschema/meson.build Normal file
View File

@@ -0,0 +1,12 @@
# server doesn't need gschema, only gui or cli
if build_gui or build_cli
gnome = import('gnome')
gschemas = files(
'org.tuf.manager.gschema.xml'
)
gnome.compile_schemas(
build_by_default: true,
depend_files: gschemas
)
install_data('org.tuf.manager.gschema.xml', install_dir: join_paths(get_option('prefix'), get_option('datadir'), 'glib-2.0', 'schemas'))
endif

View File

@@ -0,0 +1,49 @@
<schemalist>
<schema id="org.tuf.manager" path="/org/tuf/manager/" gettext-domain="tuf-manager">
<key name="restore" type="b">
<default>false</default>
<summary>Should TUF Manager restore previous settings when run</summary>
<description>
Should TUF Manager restore previous settings when run
</description>
</key>
<key name="fan-mode" type="i">
<default>0</default>
<summary>Fan mode</summary>
<description>
The saved fan mode
0 is balanced
1 is turbo
2 is silent
</description>
</key>
<key name="keyboard-mode" type="i">
<default>0</default>
<summary>Keyboard mode</summary>
<description>
The saved keyboard mode
0 is static
1 is breathing
2 is color cycle
3 is strobing
</description>
</key>
<key name="keyboard-speed" type="i">
<default>0</default>
<summary>Keyboard speed</summary>
<description>
The saved keyboard speed
0 is slow
1 is medium
2 is fast
</description>
</key>
<key name="keyboard-color" type="s">
<default>"rgb(255,0,0)"</default>
<summary>Keyboard color</summary>
<description>
The saved keyboard color in rgb format
</description>
</key>
</schema>
</schemalist>

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

19
data/icons/meson.build Normal file
View File

@@ -0,0 +1,19 @@
if build_gui
install_data('8x8/apps/tuf-manager.png', install_dir: join_paths(get_option('datadir'), 'icons/hicolor/8x8/apps'))
install_data('16x16/apps/tuf-manager.png', install_dir: join_paths(get_option('datadir'), 'icons/hicolor/16x16/apps'))
install_data('22x22/apps/tuf-manager.png', install_dir: join_paths(get_option('datadir'), 'icons/hicolor/22x22/apps'))
install_data('24x24/apps/tuf-manager.png', install_dir: join_paths(get_option('datadir'), 'icons/hicolor/24x24/apps'))
install_data('32x32/apps/tuf-manager.png', install_dir: join_paths(get_option('datadir'), 'icons/hicolor/32x32/apps'))
install_data('36x36/apps/tuf-manager.png', install_dir: join_paths(get_option('datadir'), 'icons/hicolor/36x36/apps'))
install_data('42x42/apps/tuf-manager.png', install_dir: join_paths(get_option('datadir'), 'icons/hicolor/42x42/apps'))
install_data('48x48/apps/tuf-manager.png', install_dir: join_paths(get_option('datadir'), 'icons/hicolor/48x48/apps'))
install_data('64x64/apps/tuf-manager.png', install_dir: join_paths(get_option('datadir'), 'icons/hicolor/64x64/apps'))
install_data('72x72/apps/tuf-manager.png', install_dir: join_paths(get_option('datadir'), 'icons/hicolor/72x72/apps'))
install_data('96x96/apps/tuf-manager.png', install_dir: join_paths(get_option('datadir'), 'icons/hicolor/96x96/apps'))
install_data('128x128/apps/tuf-manager.png', install_dir: join_paths(get_option('datadir'), 'icons/hicolor/128x128/apps'))
install_data('192x192/apps/tuf-manager.png', install_dir: join_paths(get_option('datadir'), 'icons/hicolor/192x192/apps'))
install_data('256x256/apps/tuf-manager.png', install_dir: join_paths(get_option('datadir'), 'icons/hicolor/256x256/apps'))
install_data('480x480/apps/tuf-manager.png', install_dir: join_paths(get_option('datadir'), 'icons/hicolor/480x480/apps'))
install_data('512x512/apps/tuf-manager.png', install_dir: join_paths(get_option('datadir'), 'icons/hicolor/512x512/apps'))
install_data('tuf-manager.png', install_dir: join_paths(get_option('datadir'), 'icons'))
endif

BIN
data/icons/tuf-manager.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 KiB

16
data/meson.build Normal file
View File

@@ -0,0 +1,16 @@
if build_gui
i18n.merge_file(
input: 'tuf-manager.desktop.in',
output: 'tuf-manager.desktop',
po_dir: join_paths(meson.source_root(), 'po'),
type: 'desktop',
install: true,
install_dir: join_paths(get_option('datadir'), 'applications')
)
endif
subdir('dbus')
subdir('polkit')
subdir('ui')
subdir('icons')
subdir('gschema')

10
data/polkit/meson.build Normal file
View File

@@ -0,0 +1,10 @@
if not always_authenticated
i18n.merge_file(
input: 'org.tuf.manager.policy.in',
output: 'org.tuf.manager.policy',
po_dir: join_paths(meson.source_root(), 'po'),
type: 'xml',
install: true,
install_dir: join_paths(get_option('datadir'), 'polkit-1', 'actions')
)
endif

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
<policyconfig>
<vendor>TUF Manager</vendor>
<vendor_url>https://git.cromer.cl/cromer/tuf-manager/</vendor_url>
<icon_name>package-x-generic</icon_name>
<action id="org.tuf.manager.save">
<message>Authentication is required</message>
<defaults>
<allow_any>no</allow_any>
<allow_inactive>auth_admin_keep</allow_inactive>
<allow_active>auth_admin_keep</allow_active>
</defaults>
</action>
</policyconfig>

View File

@@ -0,0 +1,9 @@
[Desktop Entry]
Type=Application
Name=TUF Manager
GenericName=TUF Manager
Comment=Softare to manage the fan mode and rgb keyboard.
Icon=tuf-manager
StartupNotify=true
Exec=tuf-gui
Categories=System;

11
data/ui/meson.build Normal file
View File

@@ -0,0 +1,11 @@
if build_gui
gnome = import('gnome')
tuf_manager_gresource = gnome.compile_resources(
'tuf_manager_gresource',
'tuf.manager.gresource.xml',
source_dir: '.',
c_name: 'resource_tuf_manager',
export: true,
install_header: true
)
endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/cl/cromer/tuf-manager">
<file preprocess="xml-stripblanks">tuf.manager.window.ui</file>
<file preprocess="to-pixdata">pixdata/tuf-manager.png</file>
</gresource>
</gresources>

View File

@@ -0,0 +1,266 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.2
Copyright (c) 2020
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the <organization> nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Author: Chris Cromer
-->
<interface domain="tuf-manager">
<requires lib="gtk+" version="3.10"/>
<!-- interface-license-type bsd3c -->
<!-- interface-name TUF Manager -->
<!-- interface-description Software to control fans and keyboard on ASUS TUF notebooks -->
<!-- interface-copyright 2020 -->
<!-- interface-authors Chris Cromer -->
<template class="TUFManagerGUIMainWindow" parent="GtkApplicationWindow">
<property name="can_focus">False</property>
<property name="title" translatable="yes">TUF Manager</property>
<property name="resizable">False</property>
<property name="default_width">320</property>
<property name="default_height">240</property>
<property name="icon_name">tuf-manager</property>
<property name="show_menubar">False</property>
<child type="titlebar">
<placeholder/>
</child>
<child>
<object class="GtkNotebook">
<property name="name">Tabs</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="margin_left">5</property>
<property name="margin_right">5</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="label" translatable="yes">Mode</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="keyboard_mode">
<property name="name">Keyboard Mode</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">5</property>
<property name="margin_right">5</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="active">0</property>
<items>
<item translatable="yes">Static</item>
<item translatable="yes">Breathing</item>
<item translatable="yes">Color Cycle</item>
<item translatable="yes">Strobing</item>
</items>
<signal name="changed" handler="on_keyboard_mode_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="margin_left">5</property>
<property name="margin_right">5</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="label" translatable="yes">Speed</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="keyboard_speed">
<property name="name">Speed</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">5</property>
<property name="margin_right">5</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="active">0</property>
<items>
<item translatable="yes">Slow</item>
<item translatable="yes">Medium</item>
<item translatable="yes">Fast</item>
</items>
<signal name="changed" handler="on_speed_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkColorChooserWidget" id="keyboard_color">
<property name="name">Color</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="margin_left">5</property>
<property name="margin_right">5</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="rgba">rgb(0,0,0)</property>
<property name="use_alpha">False</property>
<property name="show_editor">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="set_color">
<property name="label" translatable="yes">Set color</property>
<property name="name">Set color</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="margin_left">5</property>
<property name="margin_right">5</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<signal name="clicked" handler="on_set_color_clicked" swapped="no"/>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="width">2</property>
</packing>
</child>
</object>
</child>
<child type="tab">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Keyboard lighting</property>
</object>
<packing>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">start</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="margin_left">5</property>
<property name="margin_right">5</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="label" translatable="yes">Mode</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="fan_mode">
<property name="name">Fan Mode</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">5</property>
<property name="margin_right">5</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="active">0</property>
<items>
<item translatable="yes">Balanced</item>
<item translatable="yes">Turbo</item>
<item translatable="yes">Silent</item>
</items>
<signal name="changed" handler="on_fan_mode_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Fan control</property>
</object>
<packing>
<property name="position">1</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<placeholder/>
</child>
</object>
</child>
</template>
</interface>