Skip to content

Commit 6396bea

Browse files
authored
Merge pull request #235 from mutchiko/main
Improvments For Next Realease (ep2)
2 parents b7afe13 + 4d09954 commit 6396bea

14 files changed

Lines changed: 800 additions & 526 deletions

CMakeLists.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.25)
22

3-
project(MControlCenter VERSION 0.5.0 LANGUAGES CXX)
3+
project(MControlCenter VERSION 0.5.1 LANGUAGES CXX)
44

55
set(CMAKE_INCLUDE_CURRENT_DIR ON)
66

@@ -13,8 +13,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
1313

1414
add_compile_options(-fPIC)
1515

16-
find_package(QT NAMES Qt6 REQUIRED COMPONENTS Widgets Network)
17-
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets LinguistTools DBus Network)
16+
find_package(Qt6 6.4 REQUIRED COMPONENTS Widgets Network LinguistTools DBus)
1817

1918
set(PROJECT_SOURCES
2019
src/main.cpp
@@ -62,8 +61,7 @@ foreach(_ts_file ${TS_FILES})
6261
COMMAND_ERROR_IS_FATAL ANY
6362
)
6463
endforeach()
65-
66-
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
64+
if(Qt6_FOUND)
6765
qt_add_executable(mcontrolcenter
6866
MANUAL_FINALIZATION
6967
${PROJECT_SOURCES}
@@ -93,3 +91,4 @@ install(TARGETS mcontrolcenter
9391
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
9492

9593
add_subdirectory(src/helper ${CMAKE_BINARY_DIR}/helper)
94+
add_definitions(-DMControlCenter_VERSION="${PROJECT_VERSION}")

README.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
MControlCenter is a Free and Open Source GNU/Linux application that allows you to change the settings of MSI laptops.
44

5-
![Screenshots of MControlCenter](https://github.com/user-attachments/assets/e2ebacda-1c6b-48aa-8739-d4a88ee4af67)
5+
![Screen Shot of MCC](https://github.com/user-attachments/assets/1e1dcb9b-aa8e-4410-8c77-f9554c1840cb)
6+
67

78

89

@@ -49,6 +50,38 @@ If the `ec_sys` kernel module is not included in your distribution's kernel, you
4950
3. Open terminal in unpacked directory
5051
4. Run the script `sudo ./install`
5152

53+
**Note:** if your distribution ships old versions of Qt (older than 6.8) like ubuntu/Linux mint (Qt 6.4), you might need to build from source, continue reading.
54+
55+
## Building from source
56+
After installing the main package (```qt6-base``` or ```libqt6widgets6```), you'll need to install other packages to build the app.
57+
58+
For ubuntru/Linux mint:
59+
```qt6-base-dev``` and/or ```qt6-tools-dev```
60+
61+
For Arch ```qt6-tools``` And for fedora ```qt6-qttools```
62+
63+
After you install the packages:
64+
65+
Make sure the app is completely closed if it was installed before (check if there is a system tray icon and close it).
66+
67+
Download the source code and extract the zip file.
68+
69+
Open the ```scripts``` folder.
70+
71+
Open a terminal inside the folder, then run these scripts in order:
72+
73+
1. ```build```
74+
2. ```create installer```
75+
76+
If things went well, you should see a compressed file,
77+
78+
4. Extract it.
79+
5. Open a terminal inside the new folder
80+
6. Run the **UNINSTALL** script as *sudo*, it might fail if you don't have MCC installed. thats fine.
81+
7. Run the **INSTALL** script as *sudo*, the last line should be a confirmation that the install was successful.
82+
8. Check your apps, McontrolCenter should be there.
83+
84+
If the installation was successful but the app fails to run, open a terminal and type ```mcontrolcenter```, copy the output and open an issue (**IF** there isn't one already).
5285
### Installation from the repository
5386

5487
#### openSUSE Tumbleweed:

src/helper/CMakeLists.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.25)
22

33
project(MControlCenterHelper LANGUAGES CXX)
44

@@ -13,9 +13,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
1313

1414
add_compile_options(-fPIC)
1515

16-
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
17-
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
18-
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS DBus)
16+
find_package(Qt6 6.4 REQUIRED COMPONENTS Core DBus)
1917

2018
add_executable(mcontrolcenter-helper
2119
helper.h
@@ -25,8 +23,7 @@ add_executable(mcontrolcenter-helper
2523
msi-ec.h
2624
msi-ec.cpp
2725
)
28-
target_link_libraries(mcontrolcenter-helper Qt${QT_VERSION_MAJOR}::Core)
29-
target_link_libraries(mcontrolcenter-helper Qt${QT_VERSION_MAJOR}::DBus)
26+
target_link_libraries(mcontrolcenter-helper Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::DBus)
3027

3128
install(TARGETS mcontrolcenter-helper
3229
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

src/helper/helper.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,11 @@ void Helper::putValue(const int &address, const int &value) const {
3939
if (value >= 0 && value <= 255)
4040
rw.writeToFile(address, value);
4141
else
42-
fprintf(stderr, "Putted invalid value. Address: %d, value: %d\n", address, value);
42+
fprintf(stderr, "tried to input invalid value. Address: %d, value: %d\n", address, value);
4343
}
4444

4545
bool Helper::isEcSysModuleLoaded() const {
4646
if (rw.isEcSys()) {
47-
fprintf(stderr, "%s\n", qPrintable("The ec_sys kernel module is loaded"));
4847
return true;
4948
}
5049
if (rw.isAcpiEc()) {

src/helper/msi-ec.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ const QString msi_ec_webcam = msi_ec_path + "/webcam";
2525
const QString msi_ec_webcam_block = msi_ec_path + "/webcam_block";
2626
const QString msi_ec_fn_key = msi_ec_path + "/fn_key";
2727
const QString msi_ec_win_key = msi_ec_path + "/win_key";
28-
const QString msi_ec_battery_mode = msi_ec_path + "/battery_mode";
2928
const QString msi_ec_cooler_boost = msi_ec_path + "/cooler_boost";
3029
const QString msi_ec_available_shift_modes = msi_ec_path + "/available_shift_modes";
3130
const QString msi_ec_shift_mode = msi_ec_path + "/shift_mode";
@@ -71,7 +70,6 @@ void MsiEc::writeFileOnOff(QString path, bool on) const {
7170

7271
bool MsiEc::isMsiEcModuleLoaded() const {
7372
if (QFile::exists(msi_ec_fw_version)) {
74-
fprintf(stderr, "%s\n", qPrintable("The ec_sys kernel module is loaded"));
7573
return true;
7674
}
7775
fprintf(stderr, "%s\n", qPrintable("The msi_ec kernel module is not loaded"));
@@ -143,18 +141,6 @@ void MsiEc::setFnWinSwap(bool swap) const {
143141
setFnKey(swap ? "left" : "right");
144142
}
145143

146-
//////////////// battery_mode ////////////////
147-
148-
bool MsiEc::hasBatteryMode() const {
149-
return QFile::exists(msi_ec_battery_mode);
150-
}
151-
QString MsiEc::getBatteryMode() const {
152-
return readFile(msi_ec_battery_mode);
153-
}
154-
void MsiEc::setBatteryMode(QString mode) const {
155-
return writeFile(msi_ec_battery_mode, mode);
156-
}
157-
158144
//////////////// cooler_boost ////////////////
159145

160146
bool MsiEc::hasCoolerBoost() const {

src/helper/msi-ec.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,6 @@ public slots:
6666
[[nodiscard]] bool getFnWinSwap() const;
6767
Q_NOREPLY void setFnWinSwap(bool swap) const;
6868

69-
// battery_mode
70-
[[nodiscard]] bool hasBatteryMode() const;
71-
[[nodiscard]] QString getBatteryMode() const;
72-
Q_NOREPLY void setBatteryMode(QString mode) const;
73-
7469
// cooler_boost
7570
[[nodiscard]] bool hasCoolerBoost() const;
7671
[[nodiscard]] bool getCoolerBoost() const;

src/i18n/MControlCenter_de_DE.ts

Lines changed: 75 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@
3939
<source>Best for Mobility</source>
4040
<translation>Am besten für Mobilität</translation>
4141
</message>
42-
<message>
43-
<source>Charge the battery to 100% all the time</source>
44-
<translation>Aufladen der Batterie auf 100% die ganze Zeit</translation>
45-
</message>
4642
<message>
4743
<source>Balanced</source>
4844
<translation>Ausgeglichen</translation>
@@ -63,10 +59,6 @@
6359
<source>Custom</source>
6460
<translation>Custom</translation>
6561
</message>
66-
<message>
67-
<source>Keyboard Backlit</source>
68-
<translation>Tastaturbeleuchtung</translation>
69-
</message>
7062
<message>
7163
<source>Always on</source>
7264
<translation>Immer angeschaltet</translation>
@@ -119,10 +111,6 @@
119111
<source>Fully charged</source>
120112
<translation>Vollständig geladen</translation>
121113
</message>
122-
<message>
123-
<source>Fully charged (Discharging)</source>
124-
<translation>Vollständig geladen (Entlädt)</translation>
125-
</message>
126114
<message>
127115
<source>rpm</source>
128116
<translation>rpm</translation>
@@ -137,11 +125,7 @@
137125
</message>
138126
<message>
139127
<source>Super Battery</source>
140-
<translation>Exteme Batterie Leistung</translation>
141-
</message>
142-
<message>
143-
<source>Failed to load the ec_sys kernel module</source>
144-
<translation>Das ec_sys Kernel Modul konnte nicht geladen werden</translation>
128+
<translation>Batterie sparen</translation>
145129
</message>
146130
<message>
147131
<source>Apply</source>
@@ -197,79 +181,121 @@
197181
</message>
198182
<message>
199183
<source>Overview</source>
200-
<translation type="unfinished"></translation>
201-
</message>
202-
<message>
203-
<source>&amp;High Performance</source>
204-
<translation type="unfinished"></translation>
205-
</message>
206-
<message>
207-
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Maximum performance at the cost of heat and increased power consumption&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
208-
<translation type="unfinished"></translation>
184+
<translation>Übersicht</translation>
209185
</message>
210186
<message>
211187
<source>The middle spot between fan noise and power usage</source>
212-
<translation type="unfinished"></translation>
188+
<translation>Der Mittelpunkt zwischen Lüftergeräusch und Stromverbrauch</translation>
213189
</message>
214190
<message>
215191
<source>Low fan noise and moderate power usage</source>
216-
<translation type="unfinished"></translation>
192+
<translation>Leise Lüftergeräusche und moderater Stromverbrauch</translation>
217193
</message>
218194
<message>
219195
<source>Limits performance and turns off fans at lower temperatures</source>
220-
<translation type="unfinished"></translation>
196+
<translation>Begrenzt die Leistung und schaltet die Lüfter bei niedrigeren Temperaturen ab</translation>
221197
</message>
222198
<message>
223199
<source>GPU Fan:</source>
224-
<translation type="unfinished"></translation>
200+
<translation>GPU Lüfter:</translation>
225201
</message>
226202
<message>
227203
<source>CPU Fan:</source>
228-
<translation type="unfinished"></translation>
204+
<translation>CPU Lüfter:</translation>
229205
</message>
230206
<message>
231207
<source>USB Power</source>
232-
<translation type="unfinished"></translation>
208+
<translation>USB-Stromversorgung</translation>
233209
</message>
234210
<message>
235211
<source>FN ⇄ Meta</source>
236-
<translation type="unfinished"></translation>
212+
<translation>FN ⇄ Meta</translation>
237213
</message>
238214
<message>
239215
<source>Current fan Mode:</source>
240-
<translation type="unfinished"></translation>
241-
</message>
242-
<message>
243-
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If you mainly use your laptop with the charger plugged most of the time, it is recommended to set the charge capacity at a lower percentage (60% or 80%) to prolong your battery lifecycle.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
244-
<translation type="unfinished"></translation>
216+
<translation>Aktueller Lüftermodus:</translation>
245217
</message>
246218
<message>
247219
<source>Keyboard</source>
248-
<translation type="unfinished"></translation>
220+
<translation>Tastatur</translation>
249221
</message>
250222
<message>
251223
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:700;&quot;&gt;MC&lt;/span&gt;ontrol&lt;span style=&quot; font-weight:700;&quot;&gt;C&lt;/span&gt;enter (MCC) is an application that allows you to change the settings of MSI laptops running Linux.&lt;/p&gt;&lt;p&gt;MCC acts as a graphical interface for the &lt;span style=&quot; font-weight:700;&quot;&gt;MSI-EC &lt;/span&gt;driver that already exist in the Linux kernel, if your device is not supported (grey buttons/limited in-app functionality), please visit the msi-ec github page to get help.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
252-
<translation type="unfinished"></translation>
224+
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:700;&quot;&gt;MC&lt;/span&gt;ontrol&lt;span style=&quot; font-weight:700;&quot;&gt;C&lt;/span&gt;enter (MCC) ist eine Anwendung, mit der Sie die Einstellungen von MSI-Laptops unter Linux ändern können.&lt;/p&gt;&lt;p&gt;MCC fungiert als grafische Benutzeroberfläche für den &lt;span style=&quot; font-weight:700;&quot;&gt;MSI-EC&lt;/span&gt;-Treiber, der bereits im Linux-Kernel vorhanden ist. Wenn Ihr Gerät nicht unterstützt wird (graue Schaltflächen/eingeschränkte In-App-Funktionalität), besuchen Sie bitte die MSI-EC-GitHub-Seite, um Hilfe zu erhalten.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
253225
</message>
254226
<message>
255227
<source>MCC GitHub:</source>
256-
<translation type="unfinished"></translation>
228+
<translation>MCC GitHub:</translation>
257229
</message>
258230
<message>
259-
<source>MCC Bug tracker:</source>
260-
<translation type="unfinished"></translation>
231+
<source>MSI-EC GitHub:</source>
232+
<translation>MSI-EC GitHub:</translation>
261233
</message>
262234
<message>
263-
<source>MSI-EC GitHub:</source>
264-
<translation type="unfinished"></translation>
235+
<source>Keyboard Backlight</source>
236+
<translation>Tastaturbeleuchtung</translation>
237+
</message>
238+
<message>
239+
<source>MCC Bug Tracker:</source>
240+
<translation>MCC Bug Tracker:</translation>
241+
</message>
242+
<message>
243+
<source>MSI-EC Status:</source>
244+
<translation>MSI-EC Status:</translation>
245+
</message>
246+
<message>
247+
<source>Qt version:</source>
248+
<translation>Qt Version:</translation>
249+
</message>
250+
<message>
251+
<source>-</source>
252+
<translation>-</translation>
253+
</message>
254+
<message>
255+
<source>The msi-ec module is not loaded/installed.
256+
Check the &lt;About&gt; page for more info.</source>
257+
<translation>Das msi-ec-Modul ist nicht geladen/installiert.
258+
Weitere Informationen finden Sie auf der Seite &lt;Über&gt;.</translation>
259+
</message>
260+
<message>
261+
<source>This mode unlocks Advanced fan mode</source>
262+
<translation>Dieser Modus schaltet den erweiterten Lüftermodus frei</translation>
263+
</message>
264+
<message>
265+
<source>Charge the battery when under 90%, stop at 100%</source>
266+
<translation>Lade die Batterie, wenn sie unter 90% ist, und stoppe das Laden bei 100%</translation>
267+
</message>
268+
<message>
269+
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:700;&quot;&gt;Warning&lt;/span&gt;: Writing the wrong values to the wrong addresses &lt;span style=&quot; font-weight:700;&quot;&gt;WILL BRICK YOUR DEVICE!&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:700;&quot;&gt;Never&lt;/span&gt; write to EC memory without knowing how to do a proper &lt;span style=&quot; font-weight:700;&quot;&gt;BIOS/EC&lt;/span&gt; reset, keep in mind that a reset &lt;span style=&quot; font-weight:700;&quot;&gt;might not&lt;/span&gt; fix the device if the device got bricked/broken. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
270+
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:700;&quot;&gt;Warnung&lt;/span&gt;: Das Schreiben der falschen Werte an die falschen Adressen &lt;span style=&quot; font-weight:700;&quot;&gt;FÜHRT ZUR BESCHÄDIGUNG IHRES GERÄTS!&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;Schreiben Sie &lt;span style=&quot; font-weight:700;&quot;&gt;niemals&lt;/span&gt; in den EC-Speicher, ohne zu wissen, wie man einen ordnungsgemäßen &lt;span style=&quot; font-weight:700;&quot;&gt;BIOS/EC&lt;/span&gt;-Reset durchführt. Bedenken Sie, dass ein Reset das Gerät &lt;span style=&quot; font-weight:700;&quot;&gt;möglicherweise nicht&lt;/span&gt; repariert, wenn es beschädigt ist. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
271+
</message>
272+
<message>
273+
<source>High Performance</source>
274+
<translation>Hohe Leistung</translation>
275+
</message>
276+
<message>
277+
<source>Maximum performance at the cost of heat and increased power consumption</source>
278+
<translation>Maximale Leistung auf Kosten von Wärme und erhöhtem Stromverbrauch</translation>
279+
</message>
280+
<message>
281+
<source>The ec_sys module couldn&apos;t be detected, it might be required to control the fans.</source>
282+
<translation>Das Modul ec_sys konnte nicht erkannt werden. Möglicherweise wird es zur Steuerung der Lüfter benötigt.</translation>
283+
</message>
284+
<message>
285+
<source>Loaded</source>
286+
<translation>Geladen</translation>
287+
</message>
288+
<message>
289+
<source>Fallback: Only ec_sys is loaded</source>
290+
<translation>Fallback: Nur ec_sys wird geladen</translation>
265291
</message>
266292
<message>
267-
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;https://github.com/BeardOverflow/msi-ec&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#1ec974;&quot;&gt;https://github.com/BeardOverflow/msi-ec&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
268-
<translation type="unfinished"></translation>
293+
<source>Failed to load both msi-ec/ec_sys</source>
294+
<translation>Das Laden von msi-ec und ec_sys ist fehlgeschlagen</translation>
269295
</message>
270296
<message>
271-
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:700;&quot;&gt;Warning&lt;/span&gt;: Writing the wrong values to the wrong addresses &lt;span style=&quot; font-weight:700;&quot;&gt;WILL BRICK YOUR DEVICE!&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;Never write to EC memory without knowing how to do a proper BIOS/EC reset, keep in mind that a reset &lt;span style=&quot; font-weight:700;&quot;&gt;might not&lt;/span&gt; fix the device if the device got bricked/broken. &lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
272-
<translation type="unfinished"></translation>
297+
<source>If you mainly use your laptop with the charger plugged most of the time, it is recommended to set the charge capacity at a lower percentage (60% or 80%) to prolong your battery lifecycle.</source>
298+
<translation>Wenn Sie Ihren Laptop überwiegend mit angeschlossenem Ladegerät verwenden, empfiehlt es sich, die Ladekapazität auf einen niedrigeren Prozentsatz (60 % oder 80 %) einzustellen, um die Lebensdauer Ihres Akkus zu verlängern.</translation>
273299
</message>
274300
</context>
275301
</TS>

0 commit comments

Comments
 (0)