diff --git a/x11/lumina-core/Makefile b/x11/lumina-core/Makefile index cecdd3d46352..6bc0f8b6d5dc 100644 --- a/x11/lumina-core/Makefile +++ b/x11/lumina-core/Makefile @@ -1,65 +1,65 @@ PORTNAME= lumina-core DISTVERSIONPREFIX= v DISTVERSION= 1.6.2 -PORTREVISION= 6 +PORTREVISION= 7 CATEGORIES= x11 MAINTAINER= jwb@FreeBSD.org COMMENT= Lumina Desktop Environment WWW= https://lumina-desktop.org/ LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/../../LICENSE RUN_DEPENDS= fluxbox>=0:x11-wm/fluxbox \ fluxbox-tenr-styles-pack>=0:x11-themes/fluxbox-tenr-styles-pack \ xbrightness>=0:x11/xbrightness \ compton>=0:x11-wm/compton \ xrandr>=0:x11/xrandr \ numlockx>=0:x11/numlockx \ ${LOCALBASE}/share/icons/La-Capitaine/index.theme:x11-themes/la-capitaine-icon-theme LIB_DEPENDS+= libxcb-ewmh.so:x11/xcb-util-wm \ libxcb-icccm.so:x11/xcb-util-wm \ libxcb-image.so:x11/xcb-util-image \ libxcb-util.so:x11/xcb-util \ libXcursor.so:x11/libXcursor USES= compiler:c++11-lang desktop-file-utils gl qmake qt:5 xorg USE_GL= gl USE_XORG= x11 xdamage xcb USE_LDCONFIG= yes USE_QT= buildtools:build concurrent core dbus declarative gui \ imageformats multimedia network svg widgets x11extras USE_GITHUB= yes GH_ACCOUNT= lumina-desktop GH_PROJECT= lumina OPTIONS_DEFINE= MULTIMEDIA TRUEOS NLS OPTIONS_DEFAULT= MULTIMEDIA OPTIONS_SUB= yes MULTIMEDIA_DESC= Install multimedia support backend (gstreamer) TRUEOS_DESC= Use the TrueOS system interface settings. TRUEOS_QMAKE_ON= DEFAULT_SETTINGS=TrueOS MULTIMEDIA_USES= gstreamer MULTIMEDIA_USE= GSTREAMER=core NLS_USE= QT=linguist:build NLS_QMAKE_ON= CONFIG+=WITH_I18N WRKSRC_SUBDIR= src-qt5/core CONFIGURE_ENV+= DESTDIR=${STAGEDIR} CONFLICTS_INSTALL= lumina-1.2.* post-extract: @${RM} ${WRKSRC}/lumina-desktop*/extrafiles/screensavers/Warp* @${RM} ${WRKSRC}/lumina-desktop*/extrafiles/screensavers/*/Warp* post-install: ${FIND} ${STAGEDIR}${PREFIX}/share -name "ecp.*" -delete .include diff --git a/x11/lumina-core/files/patch-lumina-desktop_LSession.cpp b/x11/lumina-core/files/patch-lumina-desktop_LSession.cpp new file mode 100644 index 000000000000..a1246116a3ce --- /dev/null +++ b/x11/lumina-core/files/patch-lumina-desktop_LSession.cpp @@ -0,0 +1,114 @@ +--- lumina-desktop/LSession.cpp.orig 2021-12-26 02:33:45 UTC ++++ lumina-desktop/LSession.cpp +@@ -97,46 +97,96 @@ LSession::~LSession(){ + //Static function so everything can get the same icon name + QString LSession::batteryIconName(int charge, bool charging){ + int icon = -1; +- if (charge > 90) { icon = 4; } +- else if (charge > 70) { icon = 3; } +- else if (charge > 20) { icon = 2; } +- else if (charge > 5) { icon = 1; } +- else if (charge > 0 ) { icon = 0; } +- if(charging){ icon = icon+10; } ++ ++ // Add 5% in order to round to nearest 10% ++ // E.g. 85% to 94% will show 90% icon ++ icon = (charge + 5) / 10; ++ ++ //if (charge > 90) { icon = 4; } ++ //else if (charge > 70) { icon = 3; } ++ //else if (charge > 20) { icon = 2; } ++ //else if (charge > 5) { icon = 1; } ++ //else if (charge > 0 ) { icon = 0; } ++ ++ if(charging){ icon += 11; } ++ ++ // Some icons may not be available for some themes, so build a list ++ // of alternatives + QStringList iconList; + switch (icon) { ++ ++ // Draining + case 0: +- iconList << "battery-20" << "battery-020" << "battery-empty" << "battery-caution"; ++ iconList << "battery-00" << "battery-000" << "battery-empty" << "battery-caution"; + break; + case 1: +- iconList << "battery-40" << "battery-040" << "battery-low" << "battery-caution"; ++ iconList << "battery-10" << "battery-010" << "battery-low" << "battery-caution"; + break; + case 2: +- iconList << "battery-60" << "battery-060" << "battery-good"; ++ iconList << "battery-20" << "battery-020" << "battery-low" << "battery-caution"; + break; + case 3: +- iconList << "battery-80" << "battery-080" << "battery-good"; ++ iconList << "battery-30" << "battery-030" << "battery-low" << "battery-caution"; + break; + case 4: +- iconList << "battery-100" << "battery-full"; ++ iconList << "battery-40" << "battery-040" << "battery-good"; + break; ++ case 5: ++ iconList << "battery-50" << "battery-050" << "battery-good"; ++ break; ++ case 6: ++ iconList << "battery-60" << "battery-060" << "battery-good"; ++ break; ++ case 7: ++ iconList << "battery-70" << "battery-070" << "battery-good"; ++ break; ++ case 8: ++ iconList << "battery-80" << "battery-080" << "battery-good"; ++ break; ++ case 9: + case 10: ++ iconList << "battery-100" << "battery-full"; ++ break; ++ ++ // Charging ++ case 11: ++ iconList << "battery-00-charging" << "battery-000-charging" << "battery-empty-charging" << "battery-caution-charging" ++ << "battery-charging-00" << "battery-charging-000" << "battery-charging-empty" << "battery-charging-caution"; ++ break; ++ case 12: ++ iconList << "battery-01-charging" << "battery-010-charging" << "battery-empty-charging" << "battery-caution-charging" ++ << "battery-charging-01" << "battery-charging-010" << "battery-charging-empty" << "battery-charging-caution"; ++ break; ++ case 13: + iconList << "battery-20-charging" << "battery-020-charging" << "battery-empty-charging" << "battery-caution-charging" + << "battery-charging-20" << "battery-charging-020" << "battery-charging-empty" << "battery-charging-caution"; + break; +- case 11: ++ case 14: ++ iconList << "battery-30-charging" << "battery-030-charging" << "battery-low-charging" << "battery-caution-charging" ++ << "battery-charging-30" << "battery-charging-030" << "battery-charging-low" << "battery-charging-caution"; ++ break; ++ case 15: + iconList << "battery-40-charging" << "battery-040-charging" << "battery-low-charging" << "battery-caution-charging" + << "battery-charging-40" << "battery-charging-040" << "battery-charging-low" << "battery-charging-caution"; + break; +- case 12: ++ case 16: ++ iconList << "battery-50-charging" << "battery-050-charging" << "battery-low-charging" << "battery-caution-charging" ++ << "battery-charging-50" << "battery-charging-050" << "battery-charging-low" << "battery-charging-caution"; ++ break; ++ case 17: + iconList << "battery-60-charging" << "battery-060-charging" << "battery-good-charging" + << "battery-charging-60" << "battery-charging-060" << "battery-charging-good"; + break; +- case 13: ++ case 18: ++ iconList << "battery-70-charging" << "battery-070-charging" << "battery-good-charging" ++ << "battery-charging-70" << "battery-charging-070" << "battery-charging-good"; ++ break; ++ case 19: + iconList << "battery-80-charging" << "battery-080-charging" << "battery-good-charging" + << "battery-charging-80" << "battery-charging-080" << "battery-charging-good"; + break; +- case 14: ++ case 20: ++ case 21: + if(charge==100){ iconList << "battery-full-charged"; } + iconList << "battery-100-charging" << "battery-full-charging" + << "battery-charging-100" << "battery-charging-full"; diff --git a/x11/lumina-core/files/patch-lumina-desktop_panel-plugins_battery_LBattery.cpp b/x11/lumina-core/files/patch-lumina-desktop_panel-plugins_battery_LBattery.cpp new file mode 100644 index 000000000000..2fdcf84b90c6 --- /dev/null +++ b/x11/lumina-core/files/patch-lumina-desktop_panel-plugins_battery_LBattery.cpp @@ -0,0 +1,31 @@ +--- lumina-desktop/panel-plugins/battery/LBattery.cpp.orig 2021-12-26 02:33:45 UTC ++++ lumina-desktop/panel-plugins/battery/LBattery.cpp +@@ -35,7 +35,7 @@ void LBattery::updateBattery(bool force){ + QString batt_icon = LSession::batteryIconName(charge, charging); + if(iconOld != batt_icon){ + label->setPixmap( QIcon::fromTheme(batt_icon).pixmap(label->size()) ); +- if(charge <= 5 && !charging){ ++ if(charge <= 10 && !charging){ + //Play some audio warning chime when + bool playaudio = sessionsettings->value("PlayBatteryLowAudio",true).toBool(); + if( playaudio ){ +@@ -47,8 +47,17 @@ void LBattery::updateBattery(bool force){ + iconOld = batt_icon; //save for later + } + +- if(charge<=5 && !charging){ label->setStyleSheet("QLabel{ background: red;}"); } +- else if(charge>98 && charging){ label->setStyleSheet("QLabel{ background: green;}"); } ++ /* ++ * Use 40% - 80% rule for icon notifications. Lithium batteries last ++ * longer if kept between 40% and 80% charge as much as possible. ++ * Turn icon yellow when charge drops to 40% and green when charge ++ * rises to 80%. This will help the user maintain their battery ++ * in an optimal way. ++ */ ++ if(charge<=20 && !charging){ label->setStyleSheet("QLabel{ background: red;}"); } ++ else if(charge<=30 && !charging){ label->setStyleSheet("QLabel{ background: orange;}"); } ++ else if(charge<=40 && !charging){ label->setStyleSheet("QLabel{ background: yellow;}"); } ++ else if(charge>80 && charging){ label->setStyleSheet("QLabel{ background: green;}"); } + else{ label->setStyleSheet("QLabel{ background: transparent;}"); } + + //Now update the display