diff --git a/bin/webcam-fix b/bin/webcam-fix new file mode 100755 index 0000000..998bd7b --- /dev/null +++ b/bin/webcam-fix @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +sudo modprobe v4l2loopback devices=1 exclusive_caps=1 video_nr=4 card_label="virt_webcam" +ffmpeg -f v4l2 -input_format mjpeg -framerate 30 -video_size 1280x720 -i /dev/video-webcam -vcodec copy -pix_fmt yuyv422 -f v4l2 /dev/video4 +sudo rmmod v4l2loopback diff --git a/herbstluftwm/autostart b/herbstluftwm/autostart index 01a8258..31f02c6 100755 --- a/herbstluftwm/autostart +++ b/herbstluftwm/autostart @@ -2,6 +2,8 @@ # this is a simple config for herbstluftwm +PATH="$PATH:$HOME/.local/bin" + hc() { herbstclient "$@" } @@ -31,8 +33,8 @@ hc keybind $Mod-Shift-q quit hc keybind $Mod-Control-r reload hc keybind $Mod-Shift-c close hc keybind $Mod-Return spawn st -hc keybind $Mod-grave spawn quake-term -hc keybind $Mod-Control-Return spawn flatpak run org.qutebrowser.qutebrowser +hc keybind $Mod-grave spawn $HOME/skynet/bin/quake-term +hc keybind $Mod-Control-Return spawn firefox hc keybind Print spawn flameshot gui hc keybind $Mod-d spawn rofi -show drun -show-icons @@ -46,7 +48,7 @@ hc keybind XF86AudioPause spawn playerctl pause-pause hc keybind XF86AudioRaiseVolume spawn sh -c "pamixer -i 5; pamixer --get-volume >> \"$xobpipe\"; $refresh_panel" hc keybind XF86AudioLowerVolume spawn sh -c "pamixer -d 5; pamixer --get-volume >> \"$xobpipe\"; $refresh_panel" hc keybind XF86AudioMute spawn sh -c "pamixer -t; pamixer --get-volume-human | sed 's/muted/0/' >> \"$xobpipe\"; $refresh_panel" -hc keybind $Mod-a spawn sh -c "audio-output-swap; $refresh_panel" +hc keybind $Mod-a spawn sh -c "sh ~/skynet-old/scripts/audio-config.sh; $refresh_panel" hc keybind XF86Launch7 spawn sh -c "sleep 0.15 && xdotool keydown ctrl key w keyup ctrl" # basic movement in tiling and floating mode @@ -62,8 +64,8 @@ hc keybind $Mod-Shift-Down shift down hc keybind $Mod-Shift-Up shift up hc keybind $Mod-Shift-Right shift right -hc keybind $Mod-j spawn stickyctl stick -hc keybind $Mod-Shift-j spawn stickyctl unstick +hc keybind $Mod-j spawn ~/skynet-old/bin/stickyctl stick +hc keybind $Mod-Shift-j spawn ~/skynet-old/bin/stickyctl unstick # tags tag_names=( {1..9} 0 ) @@ -74,7 +76,7 @@ for i in "${!tag_names[@]}" ; do hc add "${tag_names[$i]}" key="${tag_keys[$i]}" if ! [ -z "$key" ] ; then - hc keybind "$Mod-$key" chain , lock , use_index "$i" , spawn stickyctl get-sticky , unlock + hc keybind "$Mod-$key" chain , lock , use_index "$i" , spawn ~/skynet-old/bin/stickyctl get-sticky , unlock hc keybind "$Mod-Shift-$key" move_index "$i" fi done @@ -142,6 +144,7 @@ hc rule floatplacement=smart hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' floating=on hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off +hc rule class='nvim-zen' fullscreen=on hc rule class='mpv' floating=on hc set tree_style '╾│ ├└╼─┐' diff --git a/nvim/lua/plugins-conf.lua b/nvim/lua/plugins-conf.lua index 9c00126..2110025 100644 --- a/nvim/lua/plugins-conf.lua +++ b/nvim/lua/plugins-conf.lua @@ -53,7 +53,7 @@ require'lspconfig'.tsserver.setup { on_attach = function(_, bufnr) vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') end, - cmd = { 'npx', 'typescript-language-server', '--stdio' }, + --cmd = { 'npx', 'typescript-language-server', '--stdio' }, } require'lspconfig'.yamlls.setup { capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()), diff --git a/qutebrowser/autoconfig.yml b/qutebrowser/autoconfig.yml deleted file mode 100644 index c24d89e..0000000 --- a/qutebrowser/autoconfig.yml +++ /dev/null @@ -1,29 +0,0 @@ -# If a config.py file exists, this file is ignored unless it's explicitly loaded -# via config.load_autoconfig(). For more information, see: -# https://github.com/qutebrowser/qutebrowser/blob/master/doc/help/configuring.asciidoc#loading-autoconfigyml -# DO NOT edit this file by hand, qutebrowser will overwrite it. -# Instead, create a config.py - see :help for details. - -config_version: 2 -settings: - bindings.commands: - global: - normal: - ',p': spawn --userscript qutepocket - ',m': spawn --userscript view_in_mpv - content.canvas_reading: - global: false - content.geolocation: - global: false - content.headers.accept_language: - global: en-US,en;q=0.5 - content.headers.custom: - global: - accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 - content.headers.user_agent: - global: Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Firefox/68.0 - content.notifications.enabled: - global: false - spellcheck.languages: - global: - - en-US diff --git a/qutebrowser/config.py b/qutebrowser/config.py deleted file mode 100644 index fb26dc2..0000000 --- a/qutebrowser/config.py +++ /dev/null @@ -1,11 +0,0 @@ -import os - -config.load_autoconfig() - -c.colors.webpage.preferred_color_scheme = 'dark' -c.fonts.default_size = '12pt' -#c.zoom.default = '120%' - -import glob - -c.content.user_stylesheets = glob.glob(os.path.expanduser('~/.config/qutebrowser/styles/*.css')) diff --git a/qutebrowser/greasemonkey/hckrnews.com.js b/qutebrowser/greasemonkey/hckrnews.com.js deleted file mode 100644 index 8a7867a..0000000 --- a/qutebrowser/greasemonkey/hckrnews.com.js +++ /dev/null @@ -1,52 +0,0 @@ -// ==UserScript== -// @include /^https?://(www\.|)hckrnews\.com/.*$/ -// ==/UserScript== - -GM_addStyle(` -body, -.form-actions { - background: #242424 !important; - color: #e3e0d7 !important; -} - -a { - color: #cae682 !important; -} - -.entries a.link { - color: #e3e0d7 !important; -} - -.entries a.link:visited, -.entries .source { - color: #9c998e !important; -} - -.entries .homepage { - color: #e5796d !important; -} -header a, -header a:hover { - color: #88b8f6 !important; -} - -.entries a:hover { - background-color: #080808 !important; - color: #95e454 !important; -} - -.entries .tab, -.menu .nav-pills > .active > a, -.menu .nav-pills > .active > a:hover { - background-color: #88b8f6 !important; - color: #080808 !important; -} - -.nav > li > a:hover { - background-color: #080808 !important; - color: #e3e0d7 !important; -} - -.entries .day { - border-color: #88b8f6 !important; -}`); diff --git a/qutebrowser/greasemonkey/libreddit.js b/qutebrowser/greasemonkey/libreddit.js deleted file mode 100644 index 30ae604..0000000 --- a/qutebrowser/greasemonkey/libreddit.js +++ /dev/null @@ -1,13 +0,0 @@ -// ==UserScript== -// @name Reddit to Libreddit Redirect -// @namespace RedirectRedditToLibreddit -// @description redirect reddit links to libreddit -// @include https://www.reddit.com/ -// @include https://www.reddit.com/r/* -// @include https://www.reddit.com/search* -// @version 1.01 -// @grant none -// ==/UserScript== - -var newurl = window.location.href.replace(/\/\/(www\.)?reddit.com\//, '//libreddit.spike.codes/'); -window.location.replace(newurl); diff --git a/qutebrowser/greasemonkey/login-popup-remover.js b/qutebrowser/greasemonkey/login-popup-remover.js deleted file mode 100644 index c009cf9..0000000 --- a/qutebrowser/greasemonkey/login-popup-remover.js +++ /dev/null @@ -1,561 +0,0 @@ -// ==UserScript== -// @name Login reminder popup remover -// @name:it Rimuovi i popup di richiesta d'accesso -// @namespace StephenP -// @description Removes the nagging login popups and banners from mobile and desktop versions of Facebook, Instagram, Reddit, Twitter, Quora, Ask.fm, VK and from the mobile version of Youtube. -// @description:it Rimuovi i fastidiosi banner e popup di richiesta d'accesso dalle versioni mobile e desktop di Facebook, Instagram, Reddit, Twitter, Quora, Ask.fm, VK e dalla versione mobile di Youtube. -// @match https://*.facebook.com/* -// @exclude https://developers.facebook.com/* -// @exclude https://www.instagram.com/accounts/login/* -// @exclude https://twitter.com/intent/tweet?* -// @exclude https://mobile.twitter.com/intent/tweet?* -// @match https://www.instagram.com/* -// @match https://m.youtube.com/* -// @match https://www.youtube.com/* -// @match https://www.reddit.com/* -// @match https://twitter.com/* -// @match https://mobile.twitter.com/* -// @match https://*.quora.com/* -// @match https://ask.fm/* -// @match https://vk.com/* -// @match https://m.vk.com/* -// @include https://www.pinterest.tld/* -// @version 2.2.0 -// @grant none -// @contributionURL https://nowpayments.io/donation/stephenpgreasyfork -// @icon data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAG1BMVEXTrvFOWZTEN4aXQ6vcRGPsbUH2sVjlt7/////5Q3C9AAAAAXRSTlMAQObYZgAAANJJREFUKM+9z7EKwjAQgOFIqbPFpXMUmlHMoKsQsKtgsC9g3WMkWS2V3GN7SZrQwdl/68fdlRBCFtWac74jqYLHsvBUHjiA75lGCm6dMca6BPzg9hSzajPBcQjfbKAJFLXgTJOBqQYMqAx7pnCaDRko060W5xGhwlZk20Y4R6iIaHU3inYG3euGR3UG2b0k/lYg1AABPhLDTQoRbs7D1SYoJcTHCQZvf6PsH+H5GiEcJb0Pd0Q9wdLDXV5PdVyZRF7CYgDMz/6E9xyqdPR/sMiw+gKZRGTvTIJM4gAAAABJRU5ErkJggg== -// ==/UserScript== -var interval_0; -var interval_1; -var interval_2; -var interval_3; -var interval_4; -var mutationObserver_0; -var url; -(function(){ - applyUserCss(); - setInterval(checkPageChanged,1000); -})(); -function checkPageChanged(){ - if(document.location!=url){ - console.log("Changed url from "+url+" to "+document.location.toString()); - interval_4=setInterval(checkPageReady,500); - url=document.location.toString(); - } -} -function applyUserCss(){//this function adds the css styling for removing popups to the head of the document, as soon as possible when the page is loaded. Other popups that can't be removed just with css selectors are removed later with the check() function - let st=document.createElement("STYLE"); - if(document.location.href.includes("instagram.com")){ - st.textContent=".u7YqG{z-index: 1} .xUdfV{z-index: 2} ._3sb-{z-index: 3} .G_hoz.LcKDX, ._7zNgw.GLdVF{z-index: 2} .FFVAD{z-index: 1} .tWeCl{z-index: 1} .v5DqJ, .RnEpo.Yx5HN, .RnEpo._Yhr4, .xZ2Xk, .tHaIX{display: none !important} body{overflow-y: scroll !important} .CzVzU>div{z-index: 4}"; - } - else if(document.location.href.includes("twitter.com")){ - //IF EDITING THIS LIST OF POPUPS, KEEP IT IN SYNC WITH THE POPUPS LISTED blockBannerTw - st.textContent="#layers>.css-1dbjc4n.r-aqfbo4.r-1p0dtai.r-1d2f490.r-12vffkv.r-1xcajam.r-zchlnj>.css-1dbjc4n.r-12vffkv>.css-1dbjc4n.r-12vffkv>.css-1dbjc4n.r-l5o3uw, .css-1dbjc4n.r-1awozwy.r-14lw9ot.r-1dgieki.r-1efd50x.r-5kkj8d.r-18u37iz.r-16y2uox.r-1a1dyw.r-1swwhx3.r-1j3t67a.r-1qxgc49, .css-1dbjc4n.r-1awozwy.r-1kihuf0.r-18u37iz.r-1pi2tsx.r-1777fci.r-1pjcn9w.r-1xcajam.r-ipm5af.r-g6jmlv, .css-1dbjc4n.r-aqfbo4.r-1d2f490.r-12vffkv.r-1xcajam.r-zchlnj.r-ipm5af{display: none !important}"; - } - else if(document.location.href.includes("reddit.com")){ - st.textContent=".m-blurred {filter: blur(0)} .XPromoNSFWBlocking__warning, .XPromoNSFWBlockingModal, .xPromoChoiceBanner, .XPromoPill, .XPromoPopup, .GetAppFooter, .XPromoInFeed, .XPromoBlockingModal, .PreviewDrawer, [data-testid=bottom-cell-wrapper]{display: none !important} .scroll-disabled {overflow-y: scroll !important; position: static !important} .NavFrame {overflow-y: scroll !important}"; - } - else if(document.location.href.includes("quora.com/")){ - st.textContent="*, #page_wrapper {filter: none !important} .new_signup_dialog{display: none !important} .q-platform--mobile{overflow-y: scroll !important; overflow-x: hidden !important;} .q-sticky{position: inherit !important}"; - } - else if(document.location.href.includes("https://ask.fm/")){ - st.textContent="body{overflow-y: scroll !important} .expired-countdown::after{display: none !important}"; - } - else if(document.location.href.includes("vk.com/")){ - st.textContent="body{overflow-y: scroll !important} .PageBottomBanner--unauth{display: none !important}"; - } - else if(document.location.href.includes("//m.youtube.com")){ - st.textContent=".upsell-dialog-lightbox{display: none !important} [modal-open-body]{position: inherit !important}"; - } - else if(document.location.href.includes("//www.youtube.com")){ - st.textContent="ytd-guide-signin-promo-renderer{display: none !important}"; - } - else if(document.location.href.includes("facebook.com")){ - st.textContent=".asf1osic.k4urcfbm.j9ispegn.poy2od1o.tw6a2znq.m7u2wfa4.d1544ag0.i3j981x3.rlt63pii.i09qtzwb.hybvsw6c{display: none !important}"; - if((!document.location.href.includes("m.facebook.com"))&&(!document.location.href.includes("iphone.facebook.com"))&&(!document.location.href.includes("x.facebook.com"))&&(!document.location.href.includes("touch.facebook.com"))){ - st.textContent+="#pagelet_growth_expanding_cta{display: none !important}"; - } - else if(document.location.href.includes("touch.facebook.com")){ - st.textContent+="._4b-b{display: none !important}"; - } - } - else if(document.location.href.includes("quora.com")){ - st.textContent=".signup_wall_wrapper>.BaseSignupForm._DialogSignupForm{display: none !important}"; - } - else if(document.location.href.includes("https://www.pinterest.")){ - st.textContent="[data-test-id=bottom-right-upsell], [data-test-id=giftWrap], [data-test-id=fullPageSignupModal], [data-test-id=floating-app-upsell], .FNs.XiG.zI7.iyn.Hsu{display: none !important} .article-row{-ms-overflow-style: auto !important;scrollbar-width: auto !important;} ::-webkit-scrollbar {display: block !important;} ::-webkit-scrollbar-thumb {background: grey;}"; - } - document.getElementsByTagName("HEAD")[0].appendChild(st); -} -function checkPageReady(){ - if((document.getElementsByTagName("BUTTON").length>0)||(document.getElementsByTagName("FORM").length>0)||(document.getElementsByClassName("signup_login_buttons").length>0)||(document.getElementById("layers")!==null)||(document.getElementById("mcont")!==null)){//If buttons are there, the page should have loaded. At least that's what I see... - console.log("Page is ready"); - clearInterval(interval_4); - if(document.location.href.includes("facebook.com")){ - interval_0=setInterval(blockPopupFB,500); - } - else if(document.location.href.includes("instagram.com")){ - clearInterval(interval_2); - //The following observer checks if the popup is a login popup or a suggestion to use the app: if that's not the case, the popup is displayed. - const igPopupObserverConfig = { attributes: false, childList: true, subtree: false }; - const igPopupObserverCallback = function(mutationsList, observeIgPopups) { - for(const mutation of mutationsList) { - if(mutation.addedNodes.length>0){ - //console.log(mutation); - if(mutation.addedNodes[0].classList.contains("RnEpo")){ - //console.log(!mutation.addedNodes[0].querySelector("[name='username']")); - if((!mutation.addedNodes[0].querySelector("[name='username']"))&&(!mutation.addedNodes[0].querySelector("[href*='/accounts/login/']"))){ - let style=""; - if(mutation.addedNodes[0].hasAttribute("style")){ - style=mutation.addedNodes[0].getAttribute("style"); - } - mutation.addedNodes[0].setAttribute("style","display: block !important;"+style); - } - } - } - } - }; - const observeIgPopups = new MutationObserver(igPopupObserverCallback); - observeIgPopups.observe(document.body, igPopupObserverConfig); - - //interval_1=setInterval(blockBannerIG,200); - if((document.location.href.includes('instagram.com/p/'))||(document.location.href.includes('instagram.com/tv/'))||(document.location.href.includes('/reel/'))){ - if((document.location.href.includes('/tv/'))){ - let igtvVideo=document.getElementsByTagName("VIDEO")[0]; - let cln=igtvVideo.cloneNode(true); - insertAfter(cln,igtvVideo); - igtvVideo.remove(); - } - interval_0=setInterval(allowVideoReplayStarterIG,500); - } - else if(document.location.href.includes('/channel')){ - if(document.getElementsByClassName("coreSpriteSearchIcon").length>0){//only desktop version shows login popup on igtv - interval_2=setInterval(removePicturePopupIGTV,1000); - } - } - else if((document.location.href.includes('/reels/'))|| - (document.location.href.includes('/guides/'))|| - (document.location.href.includes('/guide/'))){ - //do nothing; - } - else{//this should ideally only include the main page of the profile - //interval_2=setInterval(blockPopupIG,200); - let sectionLinks=document.getElementsByClassName("_9VEo1"); - for(let sectionLink of sectionLinks){ - if(sectionLink.href.includes("%2Ffeed%2F")){ - let tmpSectionLink=sectionLink.cloneNode(true); - tmpSectionLink.href=document.location.href+"feed/"; - sectionLink=sectionLink.parentNode.replaceChild(tmpSectionLink,sectionLink); - break; - } - } - interval_3=setInterval(removeRelatedAccounts,200); - interval_2=setInterval(removePicturePopup,500); - } - } - else if(document.location.href.includes("reddit.com")){//reddit has a wide range of different login reminders for installing the app or logging in when browsing from a phone - if(document.getElementsByClassName("TopNav__promoButton").length>0){ - var isMobile=true; - if(document.getElementsByClassName("MobileButton").length==0){ - isMobile=false; - } - redditPatch(isMobile); - } - } - else if(document.location.href.includes("quora.com/")){ - quoraPatchObserver(); - } - else if(document.location.href.includes("/twitter.com")){ - blockBannerTW("d"); - } - else if(document.location.href.includes("mobile.twitter.com")){ - blockBannerTW("m"); - } - else if(document.location.href.includes("https://ask.fm/")){ - removeAskFmLoginPopup(); - } - else if(document.location.href.includes("https://vk.com/")){ - checkVKLoginPopup("d"); - } - else if(document.location.href.includes("https://m.vk.com/")){ - checkVKLoginPopup("m"); - } - else if(document.location.href.includes("https://www.pinterest.")){ - document.body.setAttribute("style", "overflow-y: auto !important"); - } - } - else{ - console.log("still non buttons"); - } -} -function blockPopupFB(){ - var popupFB; - var loc=document.location.href; - if((loc.includes("m.facebook.com"))||(loc.includes("iphone.facebook.com"))||(loc.includes("x.facebook.com"))){ - popupFB=document.getElementById("popup_xout").parentNode.parentNode.parentNode; - } - if(popupFB==undefined){ - popupFB=document.getElementsByClassName("_5hn6")[0]; - if(popupFB==undefined){ - popupFB=document.getElementById("login_popup_cta_form").parentNode.parentNode.parentNode.parentNode; - let scrollview=document.getElementById("scrollview"); - scrollview.parentNode.lastChild.remove(); - scrollview.style.scrollbarWidth="auto"; - document.getElementsByClassName("asf1osic k4urcfbm j9ispegn poy2od1o tw6a2znq m7u2wfa4 d1544ag0 i3j981x3 rlt63pii i09qtzwb hybvsw6c")[0].remove(); - } - } - if(popupFB!==undefined){ - popupFB.parentNode.removeChild(popupFB); - clearInterval(interval_0); - } -} -function removeRelatedAccounts(){ - //var t0=performance.now(); - let morePostsBtn=document.getElementsByClassName('tCibT qq7_A z4xUb w5S7h')[0]; - if(morePostsBtn!==undefined){ - morePostsBtn.click(); - clearInterval(interval_3); - } - else{ - var closeButtons=document.getElementsByClassName("fUzmR"); - if(closeButtons.length>0){ - for(var i=0;i.css-1dbjc4n.r-aqfbo4.r-1p0dtai.r-1d2f490.r-12vffkv.r-1xcajam.r-zchlnj>.css-1dbjc4n.r-12vffkv>.css-1dbjc4n.r-12vffkv>.css-1dbjc4n.r-l5o3uw");//another popup (i don't remember which one) - } - if(largeLP!==null){ - if(mutation.target.style.overflow=="hidden"){//definitely not the right way to do it, but setting the style attributes with mutation.target.style doesn't work. - let restyle=mutation.target.getAttribute("style"); - restyle=restyle.replace("overflow: hidden","overflow: auto scroll"); - restyle=restyle.replace("margin-right: 17px","margin-right: auto"); - restyle=restyle.replace("overscroll-behavior-y: none;","overscroll-behavior-y: auto"); - restyle=restyle.replace("position: fixed","position: unset"); - mutation.target.setAttribute("style",restyle); - } - } - }); - } - mutationObserver_0 = new MutationObserver(callback_a); - mutationObserver_0.observe(document.documentElement, {attributes: true}); - } -} -function redditPatch(isMobile){ - const nav=document.getElementsByClassName("NavFrame__below-top-nav")[0]; - const config = { attributes: false, childList: true, subtree: true }; - var firstCheck=true; - var redditPic=document.body.getElementsByTagName("IMG"); - const callback = function(mutationsList, observer) { - for(const mutation of mutationsList) { - if(isMobile){ - let articles=mutation.target.getElementsByTagName("ARTICLE"); - if(articles.length>0){ - for (const article of articles){ - if(!article.classList.contains("replaced")){ - if((article.getElementsByTagName("video").length==0)&&(article.getElementsByClassName("slideImageMainDiv").length==0)){ - var articleCopy=article.cloneNode(true); - articleCopy.classList.add("replaced"); - article.replaceWith(articleCopy); - } - } - } - } - } - if(firstCheck==false){ - redditPic=mutation.target.getElementsByTagName("IMG"); - } - if(redditPic.length>0){ - for(var i=0;i1){ - let bgColor=getComputedStyle(wall[0].parentNode.children[0]).backgroundColor; - if(bgColor=="rgba(68, 68, 68, 0.85)"){ - wall[0].parentNode.children[0].remove(); - wall[0].classList.remove("qu-overflow--hidden"); - } - } - } - if(document.body.className.includes('signup_wall_prevent_scroll')){ - document.body.classList.remove('signup_wall_prevent_scroll'); - } - wall=document.getElementsByClassName('new_web_signup_wall_design'); - if(wall.length>0){ - wall[0].parentNode.parentNode.remove();//desktop - } - wall=document.getElementsByClassName('modal_bg new_signup_dialog'); - if(wall.length>0){ - wall[0].parentNode.remove();//mobile - } - wall=document.getElementsByClassName('q-absolute qu-full qu-bg--blue'); - if(wall.length>0){ - wall[0].parentNode.remove();//mobile - } -} -function searchQuora(e) { - if (e.key === 'Enter') { - window.open("https://www.quora.com/search?q="+document.getElementById("search").value,"_self"); - } -} -function removeAskFmLoginPopup(){ - try{ - const closeButton=document.createElement("DIV"); - closeButton.id="closeButton"; - closeButton.style.padding="1em"; - closeButton.style.right="1em"; - closeButton.style.top="1em"; - closeButton.style.position="absolute"; - closeButton.textContent="X"; - closeButton.style.borderRadius="3px"; - closeButton.style.backgroundColor="#666666"; - closeButton.style.color="#FFFFFF"; - closeButton.style.cursor="pointer"; - closeButton.addEventListener("click",function(e){document.getElementsByClassName("lightbox_overlay")[0].remove();}); - var lightbox=document.getElementsByClassName("lightbox_overlay"); - console.log(lightbox.length); - if(lightbox.length>0){ - if(lightbox[0].getElementsByClassName("lightbox_content-conversion").length>0){ - lightbox[0].parentNode.removeChild(lightbox[0]); - } - } - const callback = function(mutationsList, observer) { - for(const mutation of mutationsList) { - console.log("A"); - for(let newNode of mutation.addedNodes){ - if(newNode.className.includes("lightbox_overlay")){ - if(newNode.getElementsByClassName("lightbox_content-conversion").length>0){ - console.log("popup deleted"); - newNode.parentNode.removeChild(newNode); - } - else{ - newNode.appendChild(closeButton); - } - } - } - } - }; - const config = { attributes: false, childList: true, subtree: true }; - const observer = new MutationObserver(callback); - observer.observe(document.documentElement, config); - } - catch(err){console.log("ERROR: "+err);} -} -function checkVKLoginPopup(mode){ - const popups=document.getElementsByClassName("UnauthActionBoxContainer"); - if(popups.length>0){ - removeVKLoginPopup(popups[0]); - } - const config = { attributes: false, childList: true, subtree: false }; - const callback = function(mutationsList, observer) { - for(const mutation of mutationsList) { - for(let newNode of mutation.addedNodes){ - if(newNode.className.includes("UnauthActionBoxContainer")){ - removeVKLoginPopup(newNode,mode); - } - else if(newNode.getElementsByClassName("UnauthorizedActionModal")!==undefined){ - removeVKLoginPopup(newNode,mode); - } - } - } - }; - const observer = new MutationObserver(callback); - if(mode=="d"){ - observer.observe(document.getElementById("box_layer"), config); - } - else{ - observer.observe(document.body, config); - } -} -function removeVKLoginPopup(popup,mode){ - popup.remove(); - console.log("Popup removed"); - if(mode=="d"){ - document.getElementById("box_layer_bg").remove(); - document.getElementById("box_layer_wrap").remove(); - } - else{ - document.getElementById("popup_wrap").remove(); - document.getElementById("popup_overlay").remove(); - } -} -function allowVideoReplayStarterIG(){ - var imgBox=document.getElementsByClassName("pR7Pc"); - if(imgBox.length>0){ - let videoPlayer=imgBox[0].getElementsByTagName("VIDEO"); - if(videoPlayer.length>0){ - let moveTagCss=document.createElement("style"); - moveTagCss.textContent=".LcKDX, ._7zNgw.GLdVF {bottom: 3em}"; - document.body.appendChild(moveTagCss); - for (let vp of videoPlayer){ - vp.controls=true; - } - } - allowVideoReplayIG(imgBox[0]); - clearInterval(interval_0); - } - else{ - imgBox=document.getElementsByClassName("kPFhm B1JlO OAXCp"); - if(imgBox.length>0){ - let videoPlayer=imgBox[0].getElementsByTagName("VIDEO"); - if(videoPlayer.length>0){ - let moveTagCss=document.createElement("style"); - moveTagCss.textContent=".LcKDX, ._7zNgw.GLdVF {bottom: 3em}"; - document.body.appendChild(moveTagCss); - for (let vp of videoPlayer){ - vp.controls=true; - } - } - allowVideoReplayIG(imgBox[0]); - clearInterval(interval_0); - } - } -} -function allowVideoReplayIG(imgBox){ - console.log("add video controls"); - const config = { attributes: false, childList: true, subtree: true }; - const callback = function(mutationsList, observer) { - for(const mutation of mutationsList) { - for(let newNode of mutation.addedNodes){ - let videoPlayer=newNode.getElementsByTagName("VIDEO"); - if(videoPlayer.length>0){ - for (var vp of videoPlayer){ - vp.controls=true; - } - } - } - } - }; - const observer = new MutationObserver(callback); - observer.observe(imgBox, config); -} \ No newline at end of file diff --git a/qutebrowser/greasemonkey/news.ycombinator.com.js b/qutebrowser/greasemonkey/news.ycombinator.com.js deleted file mode 100644 index 82bd01b..0000000 --- a/qutebrowser/greasemonkey/news.ycombinator.com.js +++ /dev/null @@ -1,84 +0,0 @@ -// ==UserScript== -// @include /^https?://news\.ycombinator\.com/.*$/ -// ==/UserScript== - -GM_addStyle(` -body { - background-color: #080808 !important; - color: #e3e0d7 !important; -} - -#hnmain { - background-color: #242424 !important; -} - -#hnmain td[bgcolor='#ff6600'] { - background-color: #88b8f6 !important; -} - -img[src='y18.gif'] { - filter: invert(100%) !important; -} - -#hnmain td[bgcolor='#ff6600'] a:link { - color: #080808 !important; -} - -.comhead a:link, -.subtext a:visited, -.hnmore a:link, -a:visited { - color: #9c998e !important; -} - -a:link { - color: #e3e0d7 !important; -} - -a.storylink:hover { - color: #cae682 !important; -} - -font[color='#3c963c'] { - color: #95e454 !important; -} - -.c00, -.c00 a:link { - color: #e3e0d7 !important; -} - -.c5a, -.c5a a:link, -.c5a a:visited, -.c73, -.c73 a:link, -.c73 a:visited, -.c82, -.c82 a:link, -.c82 a:visited, -.c88, -.c88 a:link, -.c88 a:visited, -.c9c, -.c9c a:link, -.c9c a:visited, -.cae, -.cae a:link, -.cae a:visited, -.cbe, -.cbe a:link, -.cbe a:visited, -.cce, -.cce a:link, -.cce a:visited, -.cdd, -.cdd a:link, -.cdd a:visited { - color: #e5796d !important; -} - -.comment, -.title { - font-size: 12pt !important; -}`); diff --git a/qutebrowser/userscripts/qutepocket b/qutebrowser/userscripts/qutepocket deleted file mode 100755 index 275d0ee..0000000 --- a/qutebrowser/userscripts/qutepocket +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2017 Ondřej Kudlík (Kepi), https://kepi.cz - -# qutepocket is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# qutepocket is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with qutebrowser. If not, see . - -import os - -from pocket import Pocket, PocketAutException, PocketException - -CONSUMER_KEY = "70250-26f8e47a9dba2989767f4512" -REDIRECT_URI = "https://github.com/kepi/qutepocket/wiki/Authorized" - -SECRET = os.environ['QUTE_CONFIG_DIR'] + '/qutepocket.secrets' -REQUEST = os.environ['QUTE_CONFIG_DIR'] + '/qutepocket.request' - -FIFO = open(os.environ['QUTE_FIFO'], 'w') - - -def command(command): - FIFO.write(command + "\n") - - -def get_request_token(): - request_token = pocket.get_request_token(REDIRECT_URI) - - if not request_token: - exit(11) - - with open(REQUEST, 'w') as request_file: - request_file.write(request_token) - - auth_url = ("https://getpocket.com/auth/authorize" - "?request_token={0}" - "&redirect_uri={1}" - ).format(request_token, REDIRECT_URI) - - msg = ("Accept access, close opened page and use " - "Save to Pocket command again.") - - command('open -t %s' % auth_url) - command('message-info "%s"' % msg) - exit(0) - - -def get_access_token(): - try: - with open(REQUEST) as request_file: - request_token = request_file.read() - - access_token = pocket.get_access_token(request_token) - print(access_token) - with open(SECRET, 'w') as request_file: - request_file.write(access_token) - os.remove(REQUEST) - - msg = "Congratulation, qutepocket is authorized now :)" - command('message-info "%s"' % msg) - - except PocketAutException: - os.remove(REQUEST) - get_request_token() - exit(12) - - -def reauthorize(): - command('message-warning "Invalid secret token, trying to reauthorize."') - if os.path.isfile(SECRET): - os.remove(SECRET) - - get_request_token() - - -def add(): - try: - pocket.add(os.environ['QUTE_URL'], os.environ['QUTE_TITLE']) - command('message-info "Great, page is in your Pocket."') - - except PocketException as e: - # secret token e - if e.error_code == 107: - reauthorize() - - else: - command('message-warning "Error while Pocketing the page: %s %s"' - % (e.message, e.error_code)) - - -if not os.path.isfile(SECRET): - access_token = "" - pocket = Pocket(CONSUMER_KEY, access_token) - - if os.path.isfile(REQUEST): - get_access_token() - else: - get_request_token() - -with open(SECRET) as secrets_file: - access_token = secrets_file.read() - pocket = Pocket(CONSUMER_KEY, access_token) - add() - -FIFO.close() diff --git a/qutebrowser/userscripts/view_in_mpv b/qutebrowser/userscripts/view_in_mpv deleted file mode 100755 index 4729204..0000000 --- a/qutebrowser/userscripts/view_in_mpv +++ /dev/null @@ -1,143 +0,0 @@ -#!/usr/bin/env bash -# -# Behavior: -# Userscript for qutebrowser which views the current web page in mpv using -# sensible mpv-flags. While viewing the page in MPV, all