-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from iakii/main
新增支持Deepin
- Loading branch information
Showing
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
packages/screen_capturer_linux/lib/src/commands/deepin_screen_recorder.dart
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,40 @@ | ||
import 'dart:io'; | ||
|
||
import 'package:screen_capturer_platform_interface/screen_capturer_platform_interface.dart'; | ||
import 'package:shell_executor/shell_executor.dart'; | ||
|
||
final Map<CaptureMode, List<String>> _knownCaptureModeArgs = { | ||
CaptureMode.region: [''], | ||
CaptureMode.screen: ['-f'], | ||
CaptureMode.window: ['--dograb'], | ||
}; | ||
|
||
class _Deepin extends Command with SystemScreenCapturer { | ||
@override | ||
String get executable { | ||
return 'deepin-screen-recorder'; | ||
} | ||
|
||
@override | ||
Future<void> install() { | ||
throw UnimplementedError(); | ||
} | ||
|
||
@override | ||
Future<ProcessResult> capture({ | ||
required CaptureMode mode, | ||
String? imagePath, | ||
bool copyToClipboard = true, | ||
bool silent = true, | ||
}) { | ||
return exec( | ||
[ | ||
..._knownCaptureModeArgs[mode]!, | ||
...(imagePath != null ? ['-s', imagePath] : []), | ||
...(silent ? ['-n'] : []), | ||
], | ||
); | ||
} | ||
} | ||
|
||
final deepinScreenRecorder = _Deepin(); |
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