Commit 1633926686522fd6dafab99db2f078106349527a

Thomas de Grivel 2023-03-16T21:20:37

config

diff --git a/.Xdefaults-t495 b/.Xdefaults-t495
new file mode 100644
index 0000000..518e1f8
--- /dev/null
+++ b/.Xdefaults-t495
@@ -0,0 +1,8 @@
+! $OpenBSD: dot.Xdefaults,v 1.3 2014/07/10 10:22:59 jasper Exp $
+XTerm*loginShell:true
+XTerm*jumpScroll:true
+XTerm*saveLines:10240
+XTerm*scrollBar:false
+XTerm*faceSize:10
+XTerm*font:CourierNew
+XTerm*faceName:CourierNew
diff --git a/.emacs b/.emacs
index 7b9309a..2b0c7e1 100644
--- a/.emacs
+++ b/.emacs
@@ -12,8 +12,10 @@
   (package-refresh-contents)
   (mapc #'package-install package-selected-packages))
 
-;;  Adams
-(add-to-list 'auto-mode-alist '("\\.adams\\'" . lisp-mode))
+;; gpt
+(require 'gpt)
+(setq gpt-openai-key "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")
+(global-set-key (kbd "M-g") 'gpt-dwim)
 
 ;;  Dart
 ;(add-hook 'dart-mode-hook 'lsp)
@@ -60,7 +62,8 @@
  '(inhibit-startup-screen t)
  '(js-indent-level 2)
  '(menu-bar-mode nil)
- '(package-selected-packages '(haml-mode alchemist elixir-mode json-mode web-mode))
+ '(package-selected-packages
+   '(babel gpt haml-mode alchemist elixir-mode json-mode web-mode))
  '(web-mode-attr-indent-offset nil)
  '(web-mode-code-indent-offset 2)
  '(web-mode-markup-indent-offset 2))
diff --git a/bin/battery-t495 b/bin/battery-t495
new file mode 100755
index 0000000..7f3132e
--- /dev/null
+++ b/bin/battery-t495
@@ -0,0 +1,5 @@
+#!/bin/sh
+MAX="$(sysctl -n hw.sensors.acpibat0.watthour0 | cut -d ' ' -f 1)"      
+POWER="$(sysctl -n hw.sensors.acpibat0.watthour3 | cut -d ' ' -f 1)" 
+PERCENT=$({ echo scale=1; echo "$POWER*100/$MAX"; } | bc) 
+echo ${PERCENT}%
diff --git a/bin/status-t495 b/bin/status-t495
new file mode 100755
index 0000000..a4d34e3
--- /dev/null
+++ b/bin/status-t495
@@ -0,0 +1,2 @@
+#!/bin/sh
+xsetroot -name "$(hostname) $(~/bin/egress_interface) $(~/bin/host-ip) $(~/bin/nwid) $(~/bin/load) $(~/bin/temperature-t495) $(~/bin/battery-t495)$(~/bin/plugged) $(date)"
diff --git a/bin/temperature-t495 b/bin/temperature-t495
new file mode 100755
index 0000000..b03e81c
--- /dev/null
+++ b/bin/temperature-t495
@@ -0,0 +1,5 @@
+#!/bin/sh
+temp() {
+    sysctl -n hw.sensors.$1 | cut -d\  -f 1
+}
+echo "$(temp acpithinkpad0.temp0)°C $(temp acpithinkpad0.temp1)°C $(temp acpithinkpad0.temp2)°C $(temp ksmn0.temp0)°C"