10 Commits e8ac4a9cee ... 57e8e32903

Author SHA1 Message Date
  Adam 57e8e32903 autotune powertop 3 years ago
  Adam e7833711c7 use swaybar 3 years ago
  Adam 1b3cf20b7f remove culture and amuse locally 3 years ago
  Adam ee6271e665 use tilde for home in variables 3 years ago
  Adam 1f5e0b52f0 read ssh-agent vars in fish 3 years ago
  Adam b0e96867c3 get path for different machines 3 years ago
  Adam 1fc2fffa57 remove waybar 3 years ago
  Adam f94d1b926b show time with or without tims 3 years ago
  Adam e39d03e07c remove old functions 3 years ago
  Adam 572dff74ba expand variables in posix_source 3 years ago

+ 5 - 2
.config/fish/config.fish

@@ -8,7 +8,7 @@ function posix_source
 		if [ $v != $arr[2] ]
 			set -gx $arr[1] ($v)
 		else if [ (echo $arr[1] | cut -c1) != '#' ]
-			set -gx $arr[1] $arr[2]
+			set -gx $arr[1] (eval "echo $arr[2]")
 		end
 	end
 end
@@ -25,8 +25,11 @@ end
 
 . ~/.config/sh/aliases
 posix_source ~/.config/sh/variables
+if [ -f  ~/.config/sh/variables.(hostname) ]
+	posix_source ~/.config/sh/variables.(hostname)
+end
 
-if [ -f '/tmp/ssh-agent.fish' ]
+if [ -f /tmp/ssh-agent.fish ]
 	. /tmp/ssh-agent.fish >/dev/null
 end
 

+ 6 - 33
.config/sh/functions

@@ -285,10 +285,6 @@ alarm() {
 	echo "notify-send -u critical -i appointment-soon 'Alarm' '$2'; ffplay ~adam/Music/mps/cloister.ogg" | at "$1"
 }
 
-email() {
-	abook --mutt-query "$1" | grep -Pv '^$' | cut -f 1
-}
-
 ide() {
 	# todo get name from build script
 	kak -clear
@@ -303,17 +299,6 @@ ide() {
 	kak -c "$server_name" "$@"
 }
 
-kp() {
-	# by https://github.com/SidOfc/dotfiles/blob/d07fa3862ed065c2a5a7f1160ae98416bfe2e1ee/zsh/kp
-	pid=$(ps -ef | sed 1d | eval "fzf ${FZF_DEFAULT_OPTS} -m --header='[kill:process]'" | awk '{print $2}')
-
-	if [ "x$pid" != "x" ]
-	then
-		echo "$pid" | xargs kill -"${1:-9}"
-		kp
-	fi
-}
-
 guak() {
 	if [ $(ps aux | grep -c 'alacritty --class guak') -lt 2 ]
 	then
@@ -351,22 +336,6 @@ import_gsettings() {
 	done
 }
 
-# metaPackager() {
-# 	echo '# Updating aur'
-# 	yay -Syu
-
-# 	echo '# Updating ztm'
-# 	ztmSchemeDwd
-
-# 	echo '# Updating kindle'
-# 	kindleUpdater
-
-# 	echo '# Updating git repos'
-# 	gitManager
-
-# 	sudo -i pip install -U youtube-dl
-# }
-
 pad() {
 	num=$1
 	while [ "${#num}" -lt "$2" ]
@@ -383,8 +352,12 @@ now() {
 	hora=$(echo "$now" | colrm 3)
 	dunatim=$(echo "$now" | colrm 5 | rev | colrm 3 | rev)
 	tim=$(echo "$now" | rev | colrm 3 | rev)
-
-	printf "{\"text\": \"%s.%s.%s\"}\n" "$hora" "$dunatim" "$tim"
+	if [ "$1" = "-t" ]
+	then
+		printf "{\"text\": \"%s.%s\"}\n" "$hora" "$dunatim"
+	else
+		printf "{\"text\": \"%s.%s.%s\"}\n" "$hora" "$dunatim" "$tim"
+	fi
 }
 
 screenOnOff() {

+ 2 - 2
.config/sh/variables

@@ -1,9 +1,9 @@
 export _JAVA_AWT_WM_NONREPARENTING=1
 export GTK_THEME=Materia:dark
-export PATH=/home/adam/.local/bin:/usr/bin:/opt/texlive/2019/bin/x86_64-linuxmusl/
+export PATH=/usr/bin
 export EDITOR=kak
 export ANDROID_EMULATOR_USE_SYSTEM_LIBS=1
-export GOPATH=/home/adam/.go
+export GOPATH=~/.go
 export XZ_OPT=--threads=0
 export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig
 export LD_LIBRARY_PATH=/usr/local/lib

+ 1 - 0
.config/sh/variables.Mycroft

@@ -0,0 +1 @@
+export PATH=~/.local/bin:/usr/local/bin:/opt/texlive/2019/bin/x86_64-linuxmusl/:$PATH

+ 15 - 6
.config/sway/config

@@ -15,6 +15,20 @@ input "1:1:AT_Translated_Set_2_keyboard" {
     xkb_options grp:shifts_toggle,compose:caps
 }
 
+bar {
+	position top
+	status_command /home/adam/.local/bin/bar_status
+	height 3px
+	mode overlay
+	pango_markup enabled
+	colors {
+		focused_workspace #db9d3b #db9d3b #db9d3b
+		active_workspace #db9d3b88 #db9d3b88 #db9d3b88
+		inactive_workspace #ffffff00 #ffffff00 #ffffff00
+		background #ffffff00
+	}
+}
+
 bindsym $mod+Ctrl+w resize grow height 5 px or 2 ppt
 bindsym $mod+Ctrl+d resize grow width 5 px or 2 ppt
 
@@ -107,15 +121,10 @@ bindsym $mod+Shift+down focus down
 bindsym $mod+Shift+left focus left
 bindsym $mod+Shift+right focus right
 
-for_window [app_id="guake"] floating enable, move position center, move up 328 px, resize set 1920 400, move scratchpad;
+for_window [app_id="guake"] floating enable, move position center, move up 340 px, resize set 1920 400, move scratchpad;
 for_window [app_id="guake"] move scratchpad;
 bindsym F12 exec sh -c '. ~/.config/sh/functions; guak'
 
 #for_window [title="weechat"] move container to workspace 4
 
-for_window [app_id="waybar" floating] {
-    move position cursor
-    move down 120px # adjust if some menus still don't fit
-}
-
 exec_always ~/.config/sway/sway_startup.sh

+ 4 - 4
.config/sway/sway_startup.sh

@@ -1,10 +1,11 @@
 #!/bin/sh
 
-pgrep waybar || waybar &
-
 . /home/adam/.config/sh/variables
 . /home/adam/.config/sh/aliases
 . /home/adam/.config/sh/functions
+
+/home/adam/.local/bin/battery
+
 swaybg -i ~/Pictures/wallpapers/1000years.webp -m fill &
 
 # pgrep redshift || redshift -l "$LATITUDE":"$LONGITUDE" &
@@ -21,14 +22,13 @@ dbus-daemon --session --address=unix:path="$XDG_RUNTIME_DIR/bus" &
 pgrep mako || mako &
 
 doas laptop_mode
+doas powertop --auto-tune
 
 swayidle -w \
     timeout 600 'swaylock -f' \
     resume 'swaymsg "output * dpms on"' \
     before-sleep 'swaylock -f' &
 
-# pgrep -f culture || (cd ~/Code/rewrite/culture/ && .venv/bin/python culture.py &)
-pgrep amuse || (cd ~/Code/current/amuse/ && ./amuse -d . &)
 # festival --server &
 
 #doas /usr/bin/protonvpn c -f

+ 0 - 84
.config/waybar/config

@@ -1,84 +0,0 @@
-{
-  // static width of modules
-  // mpris module instead of mpd
-  // update date on midnight
-  "layer": "top",
-  "height": 24,
-
-  "modules-left": ["sway/workspaces"],
-  "modules-center": ["sway/window"],
-  "modules-right": ["custom/notifications", "custom/audio", "custom/network", "custom/battery", "custom/cpu", "custom/date", "custom/time", "idle_inhibitor", "tray"],
-  
-  "sway/workspaces": {
-    "format": "{icon}",
-    "format-icons": {
-      "1": "",
-      "2": "",
-      "3": "",
-      "4": "",
-      "5": "",
-      "6": "",
-      "7": "",
-      "8": "",
-      "9": "",
-      "10": "",
-      "urgent": "",
-      "focused": "",
-      "default": ""
-    }
-  },
-
-  "sway/window": {
-    "max-length": "0",
-		"format": ""
-  },
-
-  "custom/notifications": {
-    "exec": "$HOME/.config/waybar/scripts/notifications",
-    "return-type": "json",
-    "interval": 5 // todo loop on inotify
-  },
-  "custom/audio": {
-    "exec": "$HOME/.config/waybar/scripts/audio",
-    "return-type": "json",
-    "interval": 5 // todo loop?
-  },
-  "custom/network": {
-    "exec": "$HOME/.config/waybar/scripts/net",
-    "return-type": "json",
-    "interval": 5 // todo loop?
-  },
-  "custom/battery": {
-    "exec": "$HOME/.config/waybar/scripts/battery",
-    "return-type": "json",
-    "interval": 5 // todo loop?
-  },
-  "custom/cpu": {
-    "return-type": "json",
-    "exec": "$HOME/.config/waybar/scripts/cpu",
-    "interval": 5
-  },
-  "custom/date": {
-    "format": "<span font='BlexMono Nerd Font Mono'></span> {}",
-    "exec": "$HOME/.config/waybar/scripts/todayBoth --short",
-    "return-type": "json",
-    "interval": 3600 // todo loop
-  },
-  "custom/time": {
-    "format": "<span font='BlexMono Nerd Font Mono'></span> {}",
-    "exec": "$HOME/.config/waybar/scripts/now",
-    "return-type": "json",
-    "interval": 1 // todo loop
-  },
-	"idle_inhibitor": {
-    "format": "{icon}",
-    "format-icons": {
-    	"activated": "",
-      "deactivated": ""
-  	}
-	},
-  "tray": {
-		"icon-size": 16,
-    "spacing": 10
-  }
-}

+ 0 - 9
.config/waybar/scripts/audio

@@ -1,9 +0,0 @@
-#!/bin/sh
-
-volume=$(amixer sget 'Master' | grep -F '[on]' | head -n1 | grep -E '\[.*%\]' -o | tr -d '[]%')
-if [ "$volume" ]
-then
-	volume=$(qalc -t -b '12 10' "round($volume / 100 * 144)")
-
-	printf '{"text": "<span font=\"Material-Design-Icons\"></span> %s"}\n' "$volume"
-fi

+ 0 - 73
.config/waybar/scripts/battery

@@ -1,73 +0,0 @@
-#!/bin/sh
-
-energy=$(cat /sys/class/power_supply/BAT1/charge_now)
-full=$(cat /sys/class/power_supply/BAT1/charge_full)
-state=$(cat /sys/class/power_supply/BAT1/status)
-
-remainingTime=$(acpi | cut -d ',' -f3 | cut -d ' ' -f2)
-if [ "$remainingTime" = '' ]
-then
-  remainingTime=""
-else
-	hours=$(echo "$remainingTime" | cut -d':' -f1)
-	minutes=$(echo "$remainingTime" | cut -d':' -f2)
-	seconds=$(echo "$remainingTime" | cut -d':' -f3)
-  timsAll=$(qalc -t -b '12 10' "round(($seconds + $minutes * 60 + $hours * 3600) * 144 / 25)")
-  tims=$(qalc -t -b '12 12' "$timsAll % 100")
-  m=$(qalc -t -b '12 12' "round($timsAll / 100)")
-  dunaTims=$(qalc -t -b '12 12' "$m % 100")
-  hours=$(qalc -t -b '12 12' "round($m / 100)")
-  remainingTime="$hours.$dunaTims.$tims"
-fi
-
-duni=$(qalc -t -b '12 10' "min(round($energy / $full * 144), 144)")
-
-
-if [ "$state" = "Full" ]
-then
-    font="Battery 13"
-    colour="#1c9867"
-    icon=""
-    /home/adam/.local/bin/battery_notify 100
-elif [ "$state" = "Charging" ]
-then
-    colour="#db9d3b"
-    font="Battery 13"
-    icon=$(printf '%b' "\ue$(qalc -s 'basedisp none' -t -b '16 12' "0x400 + $duni")")
-elif [ "$state" = "unknown" ]
-then
-    colour='#e7e9f3'
-		font='Iosevka 6'
-    icon=""
-elif [ "$state" = "" ]
-then
-    colour='#892b30'
-		font='Iosevka 6'
-    icon=""
-else
-    if [ "$(qalc -b '12 12' -t "$duni < 6")" -eq 1 ]
-    then
-	    /home/adam/.local/bin/battery_notify 6
-      colour="#892b30"
-    elif [ "$(qalc -b '12 12' -t "$duni < 10")" -eq 1 ]
-    then
-	    /home/adam/.local/bin/battery_notify 10
-      colour="#892b30"
-    elif [ "$(qalc -b '12 12' -t "$duni < 20")" -eq 1 ]
-    then
-      colour="#db9d3b"
-    else
-      colour="#c0bcc0"
-    fi
-    font="Battery 13"
-    icon=$(printf '%b' "\ue$(qalc -s 'basedisp none' -t -b '16 12' "0x100 + $duni")")
-fi
-
-
-printf "{\"text\": \"<span font='$font' color='%s'>%s</span>%s\"" "$colour" "$icon"
-if [ "$remainingTime" != "" ] && [ "$state" != "fully-charged" ]
-then
-    echo ", \"tooltip\": \"$remainingTime\"}"
-else
-    echo "}"
-fi

+ 0 - 0
.config/waybar/scripts/cpu


Some files were not shown because too many files changed in this diff