add foot and window-tagger kde
This commit is contained in:
parent
f87567244f
commit
1ac43d5ccd
16
config/shared/foot/foot.ini
Normal file
16
config/shared/foot/foot.ini
Normal file
@ -0,0 +1,16 @@
|
||||
font=monospace:size=10
|
||||
pad=4x0
|
||||
[key-bindings]
|
||||
# scrollback-up-page=Shift+Page_Up Shift+KP_Page_Up
|
||||
# scrollback-up-half-page=none
|
||||
# scrollback-up-line=none
|
||||
# scrollback-down-page=Shift+Page_Down Shift+KP_Page_Down
|
||||
# scrollback-down-half-page=none
|
||||
# scrollback-down-line=none
|
||||
# scrollback-home=none
|
||||
# scrollback-end=none
|
||||
clipboard-copy=Control+c XF86Copy
|
||||
clipboard-paste=Control+v XF86Paste
|
||||
|
||||
[text-bindings]
|
||||
\x03=Mod4+c
|
||||
68
config/shared/window-tagger/contents/code/main.js
Normal file
68
config/shared/window-tagger/contents/code/main.js
Normal file
@ -0,0 +1,68 @@
|
||||
const version = "v11"
|
||||
//console.info("WINDOW TAGGER STARTED - " + version)
|
||||
|
||||
const windows = Array.from({length: 9}, () => null)
|
||||
|
||||
for (let i = 0; i < 9; i++) {
|
||||
registerShortcut(
|
||||
`TagWindow${i+1}`,
|
||||
`Tag current window to tag ${i+1}`,
|
||||
`Meta+Shift+${i+1}`,
|
||||
function() {
|
||||
try {
|
||||
//console.info(`Trying to tag at ${i+1}`)
|
||||
if (!workspace.activeWindow) {
|
||||
//console.info("No active window to tag")
|
||||
return
|
||||
}
|
||||
|
||||
//console.info(`Tag ${i+1}: ${workspace.activeWindow.caption}`)
|
||||
for (let j = 0; j < 9; j++) {
|
||||
if (windows[j] === workspace.activeWindow) {
|
||||
windows[j] = null;
|
||||
}
|
||||
}
|
||||
windows[i] = workspace.activeWindow
|
||||
} catch (e) {
|
||||
console.info(e)
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
registerShortcut(
|
||||
`FocusWindow${i}`,
|
||||
`Focus Window at tag ${i+1}`,
|
||||
`Meta+${i+1}`,
|
||||
function() {
|
||||
try {
|
||||
//console.info(`Total: ${windows.filter(w => w !== null).length}`)
|
||||
windows.forEach(w => {
|
||||
if (w) {
|
||||
//console.info(`- ${w.caption}`)
|
||||
}
|
||||
})
|
||||
if (!windows[i]) {
|
||||
//console.info("Tag is empty")
|
||||
return
|
||||
}
|
||||
|
||||
if (windows[i] === workspace.activeWindow) {
|
||||
windows[i].minimized = true
|
||||
//console.info("Focusing already focused window")
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
workspace.activeWindow = windows[i]
|
||||
} catch (error ) {
|
||||
// console.info(windows[i].valid, windows[i].deleted)
|
||||
// console.info("Error: ", error)
|
||||
windows[i] = null
|
||||
}
|
||||
} catch (e) {
|
||||
// console.info(e)
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
21
config/shared/window-tagger/metadata.json
Normal file
21
config/shared/window-tagger/metadata.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"KPlugin": {
|
||||
"Name": "Window Tagger",
|
||||
"Description": "Tag windows with numbers and quickly switch between them",
|
||||
"Icon": "preferences-system-windows",
|
||||
|
||||
"Authors": [
|
||||
{
|
||||
"Email": "username@gmail.com",
|
||||
"Name": "Firstname Lastname"
|
||||
}
|
||||
],
|
||||
"Id": "window-tagger",
|
||||
"Version": "1.0",
|
||||
"License": "GPLv3",
|
||||
"Website": "https://github.com/username/myscript"
|
||||
},
|
||||
"X-Plasma-API": "javascript",
|
||||
"X-Plasma-MainScript": "code/main.js",
|
||||
"KPackageStructure": "KWin/Script"
|
||||
}
|
||||
1
config/shared/window-tagger/path.txt
Normal file
1
config/shared/window-tagger/path.txt
Normal file
@ -0,0 +1 @@
|
||||
/home/tomas/.local/share/kwin/scripts
|
||||
Loading…
Reference in New Issue
Block a user