Skip to content

Commit

Permalink
alt-f4
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeems committed Jan 14, 2024
1 parent 73a11de commit a146d57
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
23 changes: 23 additions & 0 deletions applications/system-service/controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,27 @@ class Controller : public QObject{
Q_INVOKABLE void back(){ appsAPI->previousApplication(); }
Q_INVOKABLE void lock(){ appsAPI->openLockScreen(); }
Q_INVOKABLE void terminal(){ appsAPI->openTerminal(); }
Q_INVOKABLE void close(){
auto path = appsAPI->currentApplicationNoSecurityCheck();
if(path.path() == "/"){
return;
}
if(path == appsAPI->lockscreenApplication()){
return;
}
if(path == appsAPI->startupApplication()){
return;
}
if(path == appsAPI->taskSwitcherApplication()){
return;
}
auto currentApplication = appsAPI->getApplication(path);
if(
currentApplication == nullptr
|| currentApplication->stateNoSecurityCheck() == Application::Inactive
){
return;
}
currentApplication->stop();
}
};
4 changes: 4 additions & 0 deletions applications/system-service/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,8 @@ Window{
sequences: [Qt.Key_Terminal, "Ctrl+Alt+T"]
onActivated: controller.terminal()
}
Shortcut{
sequences: ["End+Alt+4", "Alt+F4"]
onActivated: controller.close()
}
}
3 changes: 3 additions & 0 deletions assets/opt/etc/keyd/oxide.conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ down = pagedown
backspace = macro(end+backspace)
l = macro(end+l)

[meta+alt]
4 = macro(leftalt+f4)

[shift+meta]
\ = |
, = {
Expand Down

0 comments on commit a146d57

Please sign in to comment.