From b15cab8fd3b26df51a2643a693311e52bce47a30 Mon Sep 17 00:00:00 2001 From: Leon Kowarschick Date: Sun, 24 May 2020 22:58:23 +0200 Subject: [PATCH] asdf --- .../configstore/update-notifier-npm.json | 2 +- files/.surf/cookies.txt | 8 -- files/.surf/script.js | 120 ------------------ files/.xmonad/.stack-work/stack.sqlite3 | Bin 45056 -> 45056 bytes files/.xmonad/lib/Config.hs | 13 +- files/scripts/casefandeamon.py | 47 +++++++ 6 files changed, 55 insertions(+), 135 deletions(-) delete mode 100644 files/.surf/cookies.txt delete mode 100644 files/.surf/script.js create mode 100755 files/scripts/casefandeamon.py diff --git a/files/.config/configstore/update-notifier-npm.json b/files/.config/configstore/update-notifier-npm.json index 90e1052..b19f77b 100644 --- a/files/.config/configstore/update-notifier-npm.json +++ b/files/.config/configstore/update-notifier-npm.json @@ -1,4 +1,4 @@ { "optOut": false, - "lastUpdateCheck": 1589975089407 + "lastUpdateCheck": 1590267793605 } \ No newline at end of file diff --git a/files/.surf/cookies.txt b/files/.surf/cookies.txt deleted file mode 100644 index a48e7bb..0000000 --- a/files/.surf/cookies.txt +++ /dev/null @@ -1,8 +0,0 @@ -.google.de TRUE / FALSE 2145916800 CONSENT WP.284bff.284ebc.28523f None -#HttpOnly_.google.de TRUE / FALSE 1601308700 NID 201=2f4m3yF905yxXJMWdugEIcX-6Xz5lfBM9inDXDUn9x-pRGmC8Wj_LH2-aJ2z-MC5iqSIygHso2ro_MXuRw4If4hfe0XJtITPp2oXXYEP8kd5_oXKoCVharylNWN-9VDW4NIVOhTiaBLJJkHYigbuvgmxUFaDWyoqJ_EYut711fE None -#HttpOnly_.google.de TRUE /verify TRUE 1601308700 SNID AI94zCAK1A3JzGA0bmpDwBJjpW02d6NyKM7uPz5BX1zV8zldCUJ9nZsltUXn9Qfh3X3RKTiq1qWUwe3C-H5IhQ Lax -#HttpOnly_.google.de TRUE / TRUE 1618233527 ANID AHWqTUkyeLYe1zHGOTFnTI8bLsAhCDbNKjZjNS7xmbSUo1S8xfEHWo04CbiulJlu None -#HttpOnly_.google.de TRUE /complete/search FALSE 1601049580 CGIC Ij90ZXh0L2h0bWwsYXBwbGljYXRpb24veGh0bWwreG1sLGFwcGxpY2F0aW9uL3htbDtxPTAuOSwqLyo7cT0wLjg None -#HttpOnly_.google.de TRUE /search FALSE 1601049580 CGIC Ij90ZXh0L2h0bWwsYXBwbGljYXRpb24veGh0bWwreG1sLGFwcGxpY2F0aW9uL3htbDtxPTAuOSwqLyo7cT0wLjg None -.google.de TRUE / FALSE 1588089581 OGPC 19016257-1: None -.google.de TRUE / TRUE 1588089672 1P_JAR 2020-03-29-16 None diff --git a/files/.surf/script.js b/files/.surf/script.js deleted file mode 100644 index 7ed390f..0000000 --- a/files/.surf/script.js +++ /dev/null @@ -1,120 +0,0 @@ - - -// ==UserScript== -// @name vimkeybindings -// @namespace renevier.fdn.fr -// @author arno -// @licence GPL/LGPL/MPL -// @description use vim keybingings (i, j, k, l, …) to navigate a web page. -// ==/UserScript== - -/* -* If you're a vim addict, and you always find yourself typing j or k in a web -* page, then wondering why it just does not go up and down like any good -* software, that user script is what you have been looking for. -*/ - -function up() { - if (window.scrollByLines) - window.scrollByLines(-1); // gecko - else - window.scrollBy(0, -12); // webkit -} - -function down() { - if (window.scrollByLines) - window.scrollByLines(1); // gecko - else - window.scrollBy(0, 12); // webkit -} - -function pageup() { - if (window.scrollByPages) - window.scrollByPages(-1); // gecko - else - window.scrollBy(0, 0 - _pageScroll()); // webkit -} - -function pagedown() { - if (window.scrollByPages) - window.scrollByPages(1); // gecko - else - window.scrollBy(0, _pageScroll()); // webkit -} - -function right() { - window.scrollBy(15, 0); -} - -function left() { - window.scrollBy(-15, 0); -} - -function home() { - window.scroll(0, 0); -} - -function bottom() { - window.scroll(document.width, document.height); -} - -// If you don't like default key bindings, customize here. -// if you want to use the combination 'Ctrl + b' (for example), use '^b' -var bindings = { - 'h' : left, - 'l' : right, - 'k' : up, - 'j' : down, - 'g' : home, - 'G' : bottom, - //'^b': pageup, - //'^f': pagedown, -} - -function isEditable(element) { - - if (element.nodeName.toLowerCase() == "textarea") - return true; - - // we don't get keypress events for text input, but I don't known - // if it's a bug, so let's test that - if (element.nodeName.toLowerCase() == "input" && element.type == "text") - return true; - - // element is editable - if (document.designMode == "on" || element.contentEditable == "true") { - return true; - } - - return false; -} - -function keypress(evt) { - var target = evt.target; - - // if we're on a editable element, we probably don't want to catch - // keypress, we just want to write the typed character. - if (isEditable(target)) - return; - - var key = String.fromCharCode(evt.charCode); - if (evt.ctrlKey) { - key = '^' + key; - } - - var fun = bindings[key]; - if (fun) - fun(); - -} - -function _pageScroll() { - // Gecko algorithm - // ---------------- - // The page increment is the size of the page, minus the smaller of - // 10% of the size or 2 lines. - return window.innerHeight - Math.min(window.innerHeight / 10, 24); -} - -window.addEventListener("keypress", keypress, false); - diff --git a/files/.xmonad/.stack-work/stack.sqlite3 b/files/.xmonad/.stack-work/stack.sqlite3 index c60e2e6924407651588e7f0a6fcee3f49125529c..f7a91f8599fa00dc4545cb36eb9c4a3af26c9031 100644 GIT binary patch delta 42 vcmZp8z|`=7X@WGP)I=F)MyZVnlcae0CNQpN00AIl*~Z32jGGtA#7_nQ7U~Tu delta 34 qcmZp8z|`=7X@WE(+e8^>Mz)O!lcY9I=wxJK5}(+pvU#CQ{A2*j?F*>@ diff --git a/files/.xmonad/lib/Config.hs b/files/.xmonad/lib/Config.hs index e7fc671..29f6b35 100644 --- a/files/.xmonad/lib/Config.hs +++ b/files/.xmonad/lib/Config.hs @@ -98,10 +98,10 @@ scratchpads = [ NS "terminal" "termite --class sp_term" (className =? "sp_term") (customFloating $ W.RationalRect 0.66 0.7 0.34 0.3) , NS "spotify" "spotify" (appName =? "spotify") defaultFloating , NS "discord" "discord" (appName =? "discord") defaultFloating - , NS "whatsapp" "whatsapp-nativefier" (("WhatsApp" `isSuffixOf`) <$> title) defaultFloating + , NS "whatsapp" launchWhatsapp (("WhatsApp" `isSuffixOf`) <$> title) defaultFloating , NS "slack" "slack" (("Slack | " `isPrefixOf`) <$> title) defaultFloating ] ---launchWhatsapp = "gtk-launch chrome-hnpfjngllnobngcgfapefoaidbinmjnm-Default.desktop" +launchWhatsapp = "gtk-launch chrome-hnpfjngllnobngcgfapefoaidbinmjnm-Default.desktop" -- Colors ------ {{{ @@ -191,8 +191,8 @@ myStartupHook = do spawnOnce "picom --config ~/.config/picom.conf" --no-fading-openclose" spawn "/home/leon/.config/polybar/launch.sh" spawnOnce "nitrogen --restore" - - + spawnOnce "mailnag" + for_ ["led1", "led2"] $ \led -> safeSpawn "sudo" ["liquidctl", "set", led, "color", "fixed", "00ffff"] -- }}} -- Keymap --------------------------------------- {{{ @@ -242,8 +242,9 @@ myKeys = , ("M-f", do sendMessage $ MTog.Toggle MTog.FULL sendMessage ToggleStruts) - , ("M-b", launchWithBackgroundInstance (className =? "qutebrowser") "bwrap --bind / / --dev-bind /dev /dev --tmpfs /tmp --tmpfs /run qutebrowser") - , ("M-S-", launchWithBackgroundInstance (className =? "Alacritty") "alacritty") + --, ("M-b", launchWithBackgroundInstance (className =? "qutebrowser") "bwrap --bind / / --dev-bind /dev /dev --tmpfs /tmp --tmpfs /run qutebrowser") + , ("M-b", safeSpawnProg "qutebrowser") + , ("M-S-", launchWithBackgroundInstance (className =? "Alacritty") "alacritty") , ("M-S-C-c", kill1) , ("M-S-C-q", io exitSuccess) diff --git a/files/scripts/casefandeamon.py b/files/scripts/casefandeamon.py new file mode 100755 index 0000000..111e73b --- /dev/null +++ b/files/scripts/casefandeamon.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 +import re +import time +import subprocess + +fans=["fan2", "fan3"] +default_fan_speed = 30 + + +def run_fan_check(): + fan_speed = default_fan_speed + sensors_out = subprocess.check_output(['sensors']) + sensors_out = sensors_out.decode('UTF-8').splitlines() + tdie_temp = [x for x in sensors_out if x.startswith("Tdie")] + + if len(tdie_temp) > 0: + temp = tdie_temp[0] + temp = float(re.findall(r"^Tdie:\s*\+(.*?)°C.+", temp)[0]) + if temp < 50: + fan_speed = 0 + elif temp < 60: + fan_speed = 10 + elif temp < 70: + fan_speed = 20 + elif temp < 75: + fan_speed = 30 + elif temp < 80: + fan_speed = 50 + elif temp < 85: + fan_speed = 100 + + print("applying fan curve to " + str(fan_speed) + "%, temp is " + str(temp)) + for fan in fans: + subprocess.run(["liquidctl", "set", fan, "speed", str(fan_speed)]) + + +while True: + try: + run_fan_check() + except: + print("There was a problem while running the fan curve") + time.sleep(5) + + + # cm-rgb-cli + +# run as casefan.service (systemctl enable casefan)