Skip to content

Commit

Permalink
Feature/add custom background flag (#1223)
Browse files Browse the repository at this point in the history
* enable useMutationTitleLogic by default

* adding isCustomBackgroundEnable config option that defaults to true

* fix typo
  • Loading branch information
IsmaelMartinez authored Apr 26, 2024
1 parent 991d7e3 commit 0330cc0
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 22 deletions.
7 changes: 4 additions & 3 deletions app/config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Here is the list of available arguments and its usage:
| clientCertPath | Custom Client Certs for corporate authentication (certificate must be in pkcs12 format) | string |
| clientCertPassword | Custom Client Certs password for corporate authentication (certificate must be in pkcs12 format) | string |
| closeAppOnCross | Close the app when clicking the close (X) cross | false |
| defaultNotificationUrgency | Default urgency for new notifications (`low`/`normal`/`critical`). Only applicable when `notificationMethod` is `electron` | normal |
| defaultURLHandler | Default application to be used to open the HTTP URLs | string |
| disableAutogain | A flag indicates whether to disable mic auto gain or not | false |
| disableGpu | A flag to disable GPU and hardware acceleration (can be useful if the window remains blank) | false |
Expand All @@ -40,10 +41,13 @@ Here is the list of available arguments and its usage:
| disableNotificationSound | Disable chat/meeting start notification sound | false |
| disableNotificationSoundIfNotAvailable | Disables notification sound unless status is Available (e.g. while in a call, busy, etc.) | false |
| disableNotificationWindowFlash | A flag indicates whether to disable window flashing when there is a notification | false |
| electronCLIFlags | Electron CLI flags to be added when the app starts | [] |
| incomingCallCommand | Command to execute on an incoming call. | |
| incomingCallCommandArgs | Arguments for the incomming call command. | |
| isCustomBackgroundEnabled | A flag indicates whether to enable custom background images or not | true |
| menubar | A value controls the menu bar behaviour | string |
| minimized | Start the application minimized | false |
| notificationMethod | Notification method to be used by the application (`web`/`electron`) | web |
| ntlmV2enabled | Set enable-ntlm-v2 value | string |
| onlineCheckMethod | Type of network test for checking online status. | string |
| optInTeamsV2 | Opt in to use Teams V2 | false |
Expand All @@ -55,9 +59,6 @@ Here is the list of available arguments and its usage:
| useMutationTitleLogic | Use MutationObserver to update counter from title | true |
| version | Show the version number | false |
| webDebug | Enable web debugging | false |
| electronCLIFlags | Electron CLI flags to be added when the app starts | [] |
| notificationMethod | Notification method to be used by the application (`web`/`electron`) | web |
| defaultNotificationUrgency | Default urgency for new notifications (`low`/`normal`/`critical`). Only applicable when `notificationMethod` is `electron` | normal |


As an example, to disable the persistence, you can run the following command:
Expand Down
39 changes: 22 additions & 17 deletions app/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ function argv(configPath, appVersion) {
describe: 'Close the app when clicking the close (X) cross',
type: 'boolean'
},
defaultNotificationUrgency: {
default: 'normal',
describe: 'Default urgency for new notifications (low/normal/critical)',
type: 'string',
choices: ['low', 'normal', 'critical']
},
defaultURLHandler: {
default: '',
describe: 'Default application to be used to open the HTTP URLs',
Expand Down Expand Up @@ -172,6 +178,11 @@ function argv(configPath, appVersion) {
describe: 'A flag indicates whether to disable window flashing when there is a notification',
type: 'boolean'
},
electronCLIFlags: {
default: [],
describe: "Electron CLI flags",
type: 'array'
},
incomingCallCommand: {
default: null,
describe: 'Command to execute on an incoming call.'
Expand All @@ -180,6 +191,11 @@ function argv(configPath, appVersion) {
default: [],
describe: 'Arguments for the incomming call command.'
},
isCustomBackgroundEnabled: {
default: true,
describe: 'A flag indicates whether to enable custom background or not',
type: 'boolean'
},
menubar: {
default: 'auto',
describe: 'A value controls the menu bar behaviour',
Expand All @@ -191,6 +207,12 @@ function argv(configPath, appVersion) {
describe: 'Start the application minimized',
type: 'boolean'
},
notificationMethod: {
default: 'web',
describe: 'Notification method to be used by the application (web/electron)',
type: 'string',
choices: ['web', 'electron']
},
ntlmV2enabled: {
default: 'true',
describe: 'Set enable-ntlm-v2 value',
Expand Down Expand Up @@ -242,23 +264,6 @@ function argv(configPath, appVersion) {
default: false,
describe: 'Enable debug at start',
type: 'boolean'
},
electronCLIFlags: {
default: [],
describe: "Electron CLI flags",
type: 'array'
},
notificationMethod: {
default: 'web',
describe: 'Notification method to be used by the application (web/electron)',
type: 'string',
choices: ['web', 'electron']
},
defaultNotificationUrgency: {
default: 'normal',
describe: 'Default urgency for new notifications (low/normal/critical)',
type: 'string',
choices: ['low', 'normal', 'critical']
}
})
.parse(process.argv.slice(1));
Expand Down
4 changes: 3 additions & 1 deletion app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ function onAppTerminated(signal) {
}

function handleAppReady() {
downloadCustomBGServiceRemoteConfig();
if (config.isCustomBackgroundEnabled) {
downloadCustomBGServiceRemoteConfig();
}
process.on('SIGTRAP', onAppTerminated);
process.on('SIGINT', onAppTerminated);
process.on('SIGTERM', onAppTerminated);
Expand Down
7 changes: 7 additions & 0 deletions com.github.IsmaelMartinez.teams_for_linux.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
<url type="bugtracker">https://github.com/IsmaelMartinez/teams-for-linux/issues</url>
<launchable type="desktop-id">com.github.IsmaelMartinez.teams_for_linux.desktop</launchable>
<releases>
<release version="1.4.31" date="2024-04-25">
<description>
<ul>
<li>Add isCustomBackgroundEnabled config option that defaults to true</li>
</ul>
</description>
</release>
<release version="1.4.30" date="2024-04-24">
<description>
<ul>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "teams-for-linux",
"version": "1.4.30",
"version": "1.4.31",
"main": "app/index.js",
"description": "Unofficial client for Microsoft Teams for Linux",
"homepage": "https://github.com/IsmaelMartinez/teams-for-linux",
Expand Down

0 comments on commit 0330cc0

Please sign in to comment.