Skip to content

Commit

Permalink
chore: bump up version to 0.2.2 ⬆️
Browse files Browse the repository at this point in the history
0.콩.콩
"폭풍저그, 콩진호가 간다!"
  • Loading branch information
Alex4386 committed Aug 26, 2023
1 parent 5fbc726 commit 4869ac7
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 20 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ Here are the cases that Decky Terminal can help you out!
* [Play BadApple](https://www.youtube.com/watch?v=pSygAG933Yw)

## TODO
* Gamepad support (up/down/left/right for arrow keys, etc.)
* **PROPERLY** implement on-screen keyboard support (currently implemented via workaround)
* ~~Gamepad support (up/down/left/right for arrow keys, etc.)~~ **Need to remove some bug**
* ~~multi-instance support (implemented on backend, but not on frontend. yet.)~~

Want some features to be implemented? Please make an issue on issues page!

## Build Instructions
### Prerequisites
* Linux Installation <sup>(for prebuilt Decky Loader CLI)</sup> or Rust **NIGHTLY** installation on POSIX Compliant OS <sup>(e.g. macOS)</sup>
Expand Down
2 changes: 1 addition & 1 deletion defaults/py_modules/decky_terminal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ async def _get_config(self) -> Optional[dict]:
return None

async def _write_config(self, config: dict) -> bool:
return await Common.write_file(self.get_config_filename(), json.dumps(config))
return await Common.write_file(self.get_config_filename (), json.dumps(config))

# TERMINAL CREATION =====================================
async def create_terminal(self, id: str, cmdline: Optional[str] = None):
Expand Down
9 changes: 4 additions & 5 deletions defaults/py_modules/decky_terminal/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@ def is_subscriber(self, ws: WebSocketServerProtocol):
return False

# WEBSOCKET - INTERNAL ==================================
def _remove_subscriber(self, ws: WebSocketServerProtocol):
async def _remove_subscriber(self, ws: WebSocketServerProtocol):
# Internal only!
if self.is_subscriber(ws):
self.subscribers.remove(ws)
if not ws.closed:
ws.close()
await ws.close()

# BROADCAST =============================================
async def broadcast_subscribers(self, data: bytes):
Expand All @@ -182,12 +182,11 @@ async def broadcast_subscribers(self, data: bytes):
await ws.send(data)

for ws in closed:
self._remove_subscriber(ws)
await self._remove_subscriber(ws)

async def close_subscribers(self):
for ws in self.subscribers:
if not ws.closed:
ws.close()
await self._remove_subscriber(ws)

# IS ALIVE ==============================================
def _is_process_started(self):
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": "decky-terminal",
"version": "0.2.1",
"version": "0.2.2",
"description": "A long-awaited terminal plugin that turns your steamdeck into Linux battlestation.",
"scripts": {
"build": "shx rm -rf dist && rollup -c",
Expand Down
23 changes: 16 additions & 7 deletions src/pages/Terminal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { AttachAddon } from "xterm-addon-attach";
import { FitAddon } from 'xterm-addon-fit';
import TerminalGlobal from "../common/global";
import XTermCSS from "../common/xterm_css";
import { FaExpand, FaGamepad, FaKeyboard, FaTimesCircle } from "react-icons/fa";
import { FaExpand, FaGamepad, FaKeyboard, FaTerminal, FaTimesCircle } from "react-icons/fa";

const Terminal: VFC = () => {

Expand Down Expand Up @@ -193,7 +193,7 @@ const Terminal: VFC = () => {
const setFocusToTerminal = () => {
setTimeout(() => {
xtermRef.current?.focus()
}, 500)
}, 100)
}

useEffect(() => {
Expand Down Expand Up @@ -258,6 +258,7 @@ const Terminal: VFC = () => {
const gamepadHandler = (evt: GamepadEvent) => {
if (config?.use_dpad) {
console.log('gamepadEvent', evt);
evt.preventDefault();

let command: string | undefined = undefined;
switch (evt.detail.button) {
Expand Down Expand Up @@ -301,16 +302,24 @@ const Terminal: VFC = () => {
(!fullScreen) ? <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: '1rem'}}>
<h1 style={{ margin: '1rem 0'}}>{title}</h1>
<Focusable style={{ fontSize: '1.5rem', display: 'flex', alignItems: 'center', justifyContent: 'flex-end', gap: '1rem' }}>
<DialogButton style={{ minWidth: '1rem' }} onClick={openKeyboard}><FaKeyboard /></DialogButton>
{
!config?.disable_virtual_keyboard ?
<DialogButton style={{ minWidth: '1rem' }} onClick={openKeyboard}><FaKeyboard /></DialogButton> :
<DialogButton style={{ minWidth: '1rem' }} onClick={setFocusToTerminal}><FaTerminal /></DialogButton>
}
<DialogButton style={{ minWidth: '1rem' }} onClick={startFullScreen}><FaExpand /></DialogButton>
</Focusable>
</div> : <div></div>
}

<ModifiedTextField ref={fakeInputRef} style={{ display: 'none' }} onClick={setFocusToTerminal} />
<div style={{boxSizing: 'content-box',}}>
<div ref={xtermDiv} tabIndex={0} onClick={openKeyboard} style={{ width: '100%', maxWidth: '100vw', margin: 0, background: '#000', padding: 0, height: fullScreen ? "calc(100vh - 5.1rem)" : "calc(100vh - 11rem)" }}></div>
</div>
{
config?.disable_virtual_keyboard && fullScreen ?
<DialogButton style={{ visibility: 'hidden', zIndex: -10, position: 'absolute' }} onClick={setFocusToTerminal}></DialogButton> :
<ModifiedTextField ref={fakeInputRef} disabled={config?.disable_virtual_keyboard ?? false} style={{ display: 'none' }} onClick={setFocusToTerminal} />
}
<Focusable onClick={openKeyboard} style={{boxSizing: 'content-box'}}>
<div ref={xtermDiv} style={{ width: '100%', maxWidth: '100vw', margin: 0, background: '#000', padding: 0, height: fullScreen ? "calc(100vh - 5rem)" : "calc(100vh - 11rem)" }}></div>
</Focusable>
</div>
</Focusable>
);
Expand Down
10 changes: 5 additions & 5 deletions src/pages/settings/SettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ import TerminalGlobal from "../../common/global";
</div>
</Focusable>
<Focusable
style={{ display: 'flex', justifyContent: 'space-between', gap: '1rem' }}>
style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: '1rem' }}>
<div>
<div className={staticClasses.Text}>Font Family</div>
<div className={staticClasses.Label}>Change the font of the terminal</div>
Expand All @@ -127,7 +127,7 @@ import TerminalGlobal from "../../common/global";
</div>
</Focusable>
<Focusable
style={{ display: 'flex', justifyContent: 'space-between', gap: '1rem' }}>
style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: '1rem' }}>
<div>
<div className={staticClasses.Text}>Font Size</div>
<div className={staticClasses.Label}>Change the font size of the terminal</div>
Expand All @@ -141,7 +141,7 @@ import TerminalGlobal from "../../common/global";
</div>
</Focusable>
<Focusable
style={{ display: 'flex', justifyContent: 'space-between', gap: '1rem' }}>
style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: '1rem' }}>
<div>
<div className={staticClasses.Text}>DPad Arrowkeys</div>
<div className={staticClasses.Label}>Use DPads as arrow key in terminal</div>
Expand All @@ -155,10 +155,10 @@ import TerminalGlobal from "../../common/global";
</div>
</Focusable>
<Focusable
style={{ display: 'flex', justifyContent: 'space-between', gap: '1rem' }}>
style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: '1rem' }}>
<div>
<div className={staticClasses.Text}>Disable Virtual Keyboard</div>
<div className={staticClasses.Label}>Use if you are using external keyboard and don't want virtual keyboard to popup.<br />(Keyboard button will just move focus to terminal)</div>
<div className={staticClasses.Label}>Use if you don't want virtual keyboard to popup when terminal is clicked or keyboard button is pressed</div>
</div>
<div style={{ minWidth: '200px' }}>
<ToggleField
Expand Down

0 comments on commit 4869ac7

Please sign in to comment.