generated from wiverson/maven-jpackage-template
-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add debug button to copy Linux command output
- Loading branch information
Showing
7 changed files
with
89 additions
and
3 deletions.
There are no files selected for viewing
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
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
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
29 changes: 29 additions & 0 deletions
29
src/main/java/com/getpcpanel/cpp/linux/SndCtrlLinuxDebug.java
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,29 @@ | ||
package com.getpcpanel.cpp.linux; | ||
|
||
import java.awt.Toolkit; | ||
import java.awt.datatransfer.StringSelection; | ||
|
||
import org.springframework.stereotype.Service; | ||
|
||
import com.getpcpanel.spring.ConditionalOnLinux; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.log4j.Log4j2; | ||
import one.util.streamex.StreamEx; | ||
|
||
@Log4j2 | ||
@Service | ||
@ConditionalOnLinux | ||
@RequiredArgsConstructor | ||
public class SndCtrlLinuxDebug { | ||
private final PulseAudioWrapper paWrapper; | ||
private final PulseAudioEventListener paEventListener; | ||
|
||
public void copyDebugOutput() { | ||
var output = StreamEx.of(paWrapper.getDebugOutput()) | ||
.append(paEventListener.getDebugOutput()) | ||
.joining("\n".repeat(5)); | ||
var content = new StringSelection(output); | ||
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(content, null); | ||
} | ||
} |
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
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
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