New functions, userscripts, slouch

Remove FZF command and add ENV
This commit is contained in:
Phantop 2018-12-18 19:33:47 -05:00
parent 61bda02a6c
commit 52e9fbe981
16 changed files with 22 additions and 1026 deletions

View File

@ -9,11 +9,11 @@ switch (tty)
# PATHS #
set -gx ANDROID_HOME $D/Source/android/sdk
set -gx fish_user_paths ~/.local/bin $ANDROID_HOME/platform-tools /usr/local/bin /usr/sbin /sbin /usr/local/sbin
set -gx fish_user_paths ~/.local/bin $ANDROID_HOME/platform-tools /usr/local/bin /usr/sbin /sbin /usr/local/sbin $PLAN9/bin
set -gx ENV .profile
# PROGRAM SETTINGS #
set -gx EDITOR nvim
set -gx FZF_DEFAULT_COMMAND 'ff'
set -gx PAGER "nvim -c 'set ft=man' -"
# AUTOJUMP #

View File

@ -1,5 +0,0 @@
# Defined in /tmp/fish.za3oIv/foobar2000.fish @ line 2
function foobar2000
clear
wine $D/Tools/Windows/foobar2000/foobar2000.exe ./ & disown
end

View File

@ -1,4 +1,4 @@
# Defined in /tmp/fish.1DIZ1f/gpu.fish @ line 1
# Defined in /tmp/fish.kr2YnC/gpu.fish @ line 2
function gpu
g push
g push $argv
end

View File

@ -1,5 +1,6 @@
# Defined in /tmp/fish.LrS0Bz/mount3ds.fish @ line 2
# Defined in /tmp/fish.qyLQlB/mount3ds.fish @ line 2
function mount3ds
mount_sd --movable ~/.3ds/movable.sed $D/Installs/Backup/3DS/Nintendo\ 3DS $D/Installs/Backup/3DS/sd
mkdir $D/Games/Roms/3DS $D/Installs/Backup/3DS/sd
mount_sd --movable ~/.3ds/movable.sed $D/Installs/Backup/3DS/Nintendo\ 3DS $D/Installs/Backup/3DS/sd
mount_titledir $D/Installs/Backup/3DS/sd/b81f00ba4783ae5a534430320002544d/title/ $D/Games/Roms/3DS
end

View File

@ -1,4 +0,0 @@
# Defined in /tmp/fish.OwF41R/mp3tag.fish @ line 2
function mp3tag
wine $D/Tools/Windows/mp3tag/Mp3tag.exe (pwd); disown
end

View File

@ -0,0 +1,4 @@
# Defined in /tmp/fish.iWjKdH/o.fish @ line 1
function o
open $argv
end

View File

@ -0,0 +1,4 @@
# Defined in /home/glados/.config/fish/functions/tmpfiles.fish @ line 2
function tmpfiles
sudo systemd-tmpfiles --create $argv
end

View File

@ -1,4 +1,4 @@
# Defined in /tmp/fish.VTW1Ge/used.fish @ line 1
# Defined in /tmp/fish.ZNLeDW/used.fish @ line 2
function used
du -h $argv
watch -n 0.1 du -h -BM $argv
end

View File

@ -0,0 +1,4 @@
# Defined in /tmp/fish.UKbxJ9/xcompress.fish @ line 1
function xcompress
xz -efvk9T 0 $argv
end

View File

@ -1,5 +1,5 @@
[FileDialog]
history=@Invalid()
lastVisited=file:///mnt/LocalDiskD/Videos/Recordings
lastVisited=file:///home/glados/Downloads
qtVersion=5.11.2
viewMode=Detail

0
.config/slouch/hooks Executable file
View File

File diff suppressed because one or more lines are too long

View File

@ -1,81 +0,0 @@
// ==UserScript==
// @name Google Drive Direct Links
// @version 1.8
// @description Direct link functionality for Google Drive
// @author Drazen Bjelovuk
// @match *://drive.google.com/*
// @grant none
// @namespace https://greasyfork.org/users/11679
// @contributionURL https://goo.gl/dYIygm
// ==/UserScript==
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
for (var i = 0; i < mutation.addedNodes.length; i++) {
var node = mutation.addedNodes[i];
if (node.dataset.target === 'linkBubble') {
var link = node.getElementsByTagName('input')[0];
var directLink = link.cloneNode(true);
directLink.classList.remove('H-qa-A-zt');
directLink.value = 'https://drive.google.com/uc?id='+ node.previousSibling.dataset.id;
directLink.onclick = function() { this.select(); };
var label = document.createElement('p');
label.style.cssText = "margin-top: 0px; margin-bottom: 0px;";
label.textContent = 'Direct link:';
link.parentNode.insertBefore(directLink, link.nextSibling);
link.parentNode.insertBefore(label, link.nextSibling);
break;
}
else
setClickEvent(node);
}
});
});
var content = document.getElementById('drive_main_page');
if (content)
observer.observe(content, { childList: true, subtree: true });
function setClickEvent(elem) {
if (elem.classList && (elem.classList.contains('a-u-xb-j') || elem.classList.contains('a-t-J')))
elem.addEventListener('contextmenu', adjustMenu);
else {
for (var i = 0; i < elem.children.length; i++)
setClickEvent(elem.children[i]);
}
}
function adjustMenu() {
var file = this;
setTimeout(function() {
var menus = document.getElementsByClassName('h-w');
for (var i = 0; i < menus.length; i++) {
var menu = menus[i];
if (menu.style.display !== 'none') {
var existing = document.getElementById('DLID');
if (existing)
existing.remove();
var container = menu.children[0];
var clone = container.children[0].cloneNode(true);
clone.id = 'DLID';
clone.style.display = 'block';
clone.className = 'h-v';
clone.getElementsByClassName('a-v-T')[0].innerHTML = 'Open direct';
clone.onmouseleave = clone.onmouseenter = function() {
this.classList.toggle('h-v-pc');
};
clone.onclick = function() {
window.open('https://drive.google.com/uc?id='+ file.dataset.id);
};
container.insertBefore(clone, container.children[1]);
break;
}
}
});
}

View File

@ -1,84 +0,0 @@
// ==UserScript==
// @name Google Image "View Image" button
// @version 0.1.2
// @description Add "View Image" button.
// @description:ru Добавляет кнопку просмотра изображения.
// @author gvvad
// @run-at document-end
// @include http*://www.google.*.*/*
// @include http*://google.*.*/*
// @include http*://www.google.*/*
// @include http*://google.*/*
// @grant none
// @license GPL-3.0+; http://www.gnu.org/licenses/gpl-3.0.txt
// @namespace https://greasyfork.org/users/100160
// ==/UserScript==
(function() {
'use strict';
let observer = new MutationObserver(function(mRecord) {
for (let mutation of mRecord) {
try {
//"table.irc_but_r" - image preview area, 3 count should be
let ar_table = document.querySelectorAll("table.irc_but_r");
for (let table of ar_table) {
try {
let tr = table.querySelector("tr");
let td = table.querySelector("td");
//make copy of current button
let newTd = td.cloneNode(true);
//change title and insert after 1`st <td>
for (let spn of newTd.querySelectorAll("span")) {
if (spn.innerText) {
spn.innerText = "View";
break;
}
}
newTd.querySelector("a").removeAttribute("class");
newTd.querySelector("a").removeAttribute("jsaction");
if (td.nextSibling) {
tr.insertBefore(newTd, td.nextSibling);
} else {
tr.appendChild(newTd);
}
//finding "img.irc_mi" up on tree
let node = table.parentNode;
while (node) {
//watchdog for img preview object
let img = node.querySelector("img.irc_mi");
if (img) {
let obs = new MutationObserver(function(mutList) {
for (let mut of mutList) {
try {
//change <a href> to <img src>
let src = mut.target.querySelector("img.irc_mi").src;
this._a.href = src || this._a.href;
this._a.setAttribute("rel", "noreferrer");
} catch (e) {}
}
});
//store new button <a> node in observer object
obs._a = newTd.querySelector("a");
//observe <img> parent(<a>)
obs.observe(img.parentNode, {attributes: false, childList: true, characterData: false});
break;
}
node = node.parentNode;
}
} catch (e) {}
}
//disconnect when img preview loaded
if (ar_table.length) {
this.disconnect();
}
} catch (e) {}
}
});
observer.observe(document.body, {attributes: false, childList: true, characterData: false});
})();

View File

@ -1,48 +0,0 @@
// ==UserScript==
// @name Mangadex HQ Covers
// @version 0.7
// @description try to take over the world!
// @author AviKav
// @match https://*.mangadex.org
// @match https://*.mangadex.org/titles
// @match https://*.mangadex.org/search
// @match https://*.mangadex.org/featured
// @match https://*.mangadex.org/follows/manga*
// @match https://*.mangadex.org/quick_search
// @grant none
// @run-at document-end
// ==/UserScript==
(function () {
'use strict';
const thumbnailUrlSubstrings = ['.thumb', '.large'];
const imageExtensions = ['.jpg', '.jpeg', '.png', '.gif']; // Order in which to check for images
let tags = document.getElementsByTagName('img');
// let oldtags = tags;
for (let tag of tags) {
let originalImageUrl = tag.src;
if (!(originalImageUrl.includes(thumbnailUrlSubstrings[0]) || // Yeah, I'm too lazy to iterate through the array, `break` the inner loop, and `continue1 the outer loop.
originalImageUrl.includes(thumbnailUrlSubstrings[1]))) {
continue;
}
console.log(tag)
// I can't regex
let cutUrl = originalImageUrl.replace('https://mangadex.org/images/manga/', '');
let seriesID = cutUrl.split('.')[0];
let partialUrl = 'https://mangadex.org/images/manga/' + seriesID;
(async () => {
for (let extension of imageExtensions) {
let potentialImageUrl = partialUrl + extension;
let response = await fetch(potentialImageUrl, { method: 'HEAD' });
if (response.ok) {
tag.src = potentialImageUrl;
return;
}
}
})();
}
})();

File diff suppressed because one or more lines are too long