feat: use different .dtfiles config setup
This commit is contained in:
35
.config/waybar/scripts/nohup.out
Normal file
35
.config/waybar/scripts/nohup.out
Normal file
@@ -0,0 +1,35 @@
|
||||
[2022-07-06 12:54:31.514] [info] Using configuration file /home/max/.config/waybar/config
|
||||
[2022-07-06 12:54:31.515] [info] Using CSS file /home/max/.config/waybar/style.css
|
||||
[2022-07-06 12:54:31.562] [info] config update for bar-0: id bar-0, mode dock, hidden_state hide
|
||||
[2022-07-06 12:54:31.565] [warning] As using a timezone, some format args may be missing as the date library haven't got a release since 2018.
|
||||
[2022-07-06 12:54:31.594] [warning] Waybar has been built without rfkill support.
|
||||
|
||||
** (waybar:7369): WARNING **: 12:54:31.720: gtk-layer-shell v0.7.0 may not work on GTK v3.24.34. If you experience crashes, check https://github.com/wmww/gtk-layer-shell/blob/master/compatibility.md
|
||||
[2022-07-06 12:54:31.842] [warning] Requested height: 20 is less than the minimum height: 40 required by the modules
|
||||
[2022-07-06 12:54:31.842] [info] Bar configured (width: 1920, height: 40) for output: eDP-1
|
||||
Failed to communicate with power-profiles-daemon: g-dbus-error-quark: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Not Authorized: net.hadess.PowerProfiles.switch-profile (9)
|
||||
🐢
|
||||
[2022-07-06 12:58:10.903] [info] Using configuration file /home/max/.config/waybar/config
|
||||
[2022-07-06 12:58:10.910] [info] Using CSS file /home/max/.config/waybar/style.css
|
||||
[2022-07-06 12:58:10.917] [info] config update for bar-0: id bar-0, mode dock, hidden_state hide
|
||||
[2022-07-06 12:58:10.918] [warning] As using a timezone, some format args may be missing as the date library haven't got a release since 2018.
|
||||
[2022-07-06 12:58:10.927] [warning] Waybar has been built without rfkill support.
|
||||
|
||||
** (waybar:1557): WARNING **: 12:58:10.947: gtk-layer-shell v0.7.0 may not work on GTK v3.24.34. If you experience crashes, check https://github.com/wmww/gtk-layer-shell/blob/master/compatibility.md
|
||||
[2022-07-06 12:58:10.962] [warning] Requested height: 20 is less than the minimum height: 40 required by the modules
|
||||
[2022-07-06 12:58:10.962] [info] Bar configured (width: 1920, height: 40) for output: eDP-1
|
||||
[2022-07-26 01:09:41.209] [info] Using configuration file /home/max/.config/waybar/config
|
||||
[2022-07-26 01:09:41.221] [info] Using CSS file /home/max/.config/waybar/style.css
|
||||
[2022-07-26 01:09:41.246] [info] config update for bar-0: id bar-0, mode dock, hidden_state hide
|
||||
[2022-07-26 01:09:41.247] [warning] As using a timezone, some format args may be missing as the date library haven't got a release since 2018.
|
||||
[2022-07-26 01:09:41.278] [warning] Waybar has been built without rfkill support.
|
||||
|
||||
** (waybar:491379): WARNING **: 01:09:41.375: gtk-layer-shell v0.7.0 may not work on GTK v3.24.34. If you experience crashes, check https://github.com/wmww/gtk-layer-shell/blob/master/compatibility.md
|
||||
[2022-07-26 01:09:41.388] [warning] Requested height: 20 is less than the minimum height: 40 required by the modules
|
||||
[2022-07-26 01:09:41.388] [info] Bar configured (width: 1920, height: 40) for output: eDP-1
|
||||
[2022-12-28 14:08:55.894] [info] Using configuration file /home/max/.config/waybar/config
|
||||
[2022-12-28 14:08:55.894] [info] Using CSS file /home/max/.config/waybar/style.css
|
||||
[2022-12-28 14:08:55.900] [info] config update for bar-0: id bar-0, mode dock, hidden_state hide
|
||||
[2022-12-28 14:08:55.900] [warning] As using a timezone, some format args may be missing as the date library haven't got a release since 2018.
|
||||
[2022-12-28 14:08:55.951] [warning] Requested height: 20 is less than the minimum height: 44 required by the modules
|
||||
[2022-12-28 14:08:55.951] [info] Bar configured (width: 1920, height: 44) for output: eDP-1
|
6
.config/waybar/scripts/power-consumption
Executable file
6
.config/waybar/scripts/power-consumption
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
echo - | awk "{printf \"%.1f\", \
|
||||
$(( \
|
||||
$(cat /sys/class/power_supply/BAT0/current_now) * \
|
||||
$(cat /sys/class/power_supply/BAT0/voltage_now) \
|
||||
)) / 1000000000000 }" ; echo "W "
|
25
.config/waybar/scripts/power-profile
Executable file
25
.config/waybar/scripts/power-profile
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
CURRENT=$(powerprofilesctl get)
|
||||
|
||||
LOW="🐢"
|
||||
BALANCED="☯️"
|
||||
HIGH="🐇"
|
||||
|
||||
if [ "$CURRENT" = 'power-saver' ]; then
|
||||
if [ "$1" = "--toggle" ]; then
|
||||
powerprofilesctl set balanced
|
||||
fi
|
||||
echo $LOW
|
||||
elif [ "$CURRENT" = 'balanced' ]; then
|
||||
if [ "$1" = "--toggle" ]; then
|
||||
powerprofilesctl set performance
|
||||
fi
|
||||
echo $BALANCED
|
||||
elif [ "$CURRENT" = 'performance' ]; then
|
||||
if [ "$1" = "--toggle" ]; then
|
||||
powerprofilesctl set power-saver
|
||||
fi
|
||||
echo $HIGH
|
||||
fi
|
||||
|
||||
|
216
.config/waybar/scripts/set-theme
Executable file
216
.config/waybar/scripts/set-theme
Executable file
@@ -0,0 +1,216 @@
|
||||
#!/usr/bin/env bash
|
||||
# https://gitlab.com/wef/dotfiles/-/blob/master/bin/dark-mode
|
||||
|
||||
TIME_STAMP="20220227.144601"
|
||||
|
||||
# dark-mode [light|dark|refresh]
|
||||
# sets dark mode on or off
|
||||
|
||||
# Copyright (C) 2021 Bob Hepple < bob dot hepple at gmail dot com>
|
||||
|
||||
# This program 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.
|
||||
#
|
||||
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# I like to have this called by my
|
||||
# ~/.config/i3blocks/i3blocks/weather script which runs every 10m and
|
||||
# knows about sunset and sunrise times.
|
||||
|
||||
|
||||
PROG=$( basename $0 )
|
||||
|
||||
KITTY_ONLY=""
|
||||
[[ "$1" == "--kitty-only" ]] && {
|
||||
KITTY_ONLY="true"
|
||||
shift
|
||||
}
|
||||
|
||||
CMD="$1"
|
||||
|
||||
DARK_MODE_STATUS_FILE=~/.cache/dark-mode
|
||||
CURRENT_DARK_MODE=$( cat $DARK_MODE_STATUS_FILE )
|
||||
|
||||
case $CMD in
|
||||
-h|--help)
|
||||
echo "Usage: $PROG <[on|start|dark]|refresh|[off|stop|light]>"
|
||||
echo
|
||||
echo "toggles or refreshes dark-mode for emacs, kitty, gtk and qt"
|
||||
exit 0
|
||||
;;
|
||||
on|start|dark)
|
||||
CMD="dark"
|
||||
;;
|
||||
re*)
|
||||
CMD="refresh"
|
||||
;;
|
||||
*) # off|stop|light
|
||||
CMD="light"
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$CMD" == "refresh" ]]; then
|
||||
CMD="$CURRENT_DARK_MODE"
|
||||
else
|
||||
[[ "$CURRENT_DARK_MODE" == "$CMD" ]] && exit 0
|
||||
fi
|
||||
|
||||
# for emacs, these themes can be chosen from the standard ones (in
|
||||
# custom-theme-load-path) or they can be installed in
|
||||
# custom-theme-directory (usually ~/.emacs.d)
|
||||
# They must have a filename of $THEMENAME-theme.el
|
||||
|
||||
case "$CMD" in
|
||||
light)
|
||||
# light mode
|
||||
# new_emacs_theme="dichromacy-bh"
|
||||
# new_emacs_theme="modus-operandi"
|
||||
#new_emacs_theme="Adwaita" # text background is #ededed !!!
|
||||
#new_emacs_theme="solarized-light"
|
||||
# new_emacs_modeline_theme="smart-mode-line-light"
|
||||
|
||||
# new_gtk_theme='WhiteSur'
|
||||
new_gtk_theme='adw-gtk3'
|
||||
#new_gtk_theme='Solarized-Light'
|
||||
#new_gtk_theme='Crux'
|
||||
|
||||
new_icon_theme='WhiteSur'
|
||||
new_cursor_theme='WhiteSur-cursors'
|
||||
|
||||
# new_kitty_theme="$HOME/.config/kitty/Adwaita.conf"
|
||||
|
||||
# new_nvim_theme="dayfox"
|
||||
|
||||
new_kitty_theme="Atom One Light"
|
||||
# new_fg='black'
|
||||
# new_fg='00/00/00'
|
||||
# new_bg='white'
|
||||
# new_bg='ff/ff/ff'
|
||||
BRIGHTNESS=100
|
||||
TERM_BACKGROUND=light
|
||||
;;
|
||||
*)
|
||||
# dark mode
|
||||
# new_emacs_theme="dichromacy-dark-bh"
|
||||
# new_emacs_theme="modus-vivendi"
|
||||
# new_emacs_theme="manoj-dark-bh"
|
||||
# new_emacs_theme="solarized-dark"
|
||||
# new_emacs_modeline_theme="smart-mode-line-dark"
|
||||
|
||||
new_gtk_theme='adw-gtk3-dark'
|
||||
#new_gtk_theme='Solarized-Dark'
|
||||
#new_gtk_theme='Crux-dark'
|
||||
|
||||
# 'Breeze' icons are too dark for Adwaita-dark:
|
||||
new_icon_theme='WhiteSur-dark'
|
||||
new_cursor_theme='WhiteSur-cursors'
|
||||
|
||||
#new_kitty_theme="$HOME/.config/kitty/Adwaita-dark.conf"
|
||||
new_kitty_theme="Argonaut"
|
||||
|
||||
# new_nvim_theme="nightfox"
|
||||
# new_fg='white'
|
||||
# new_fg='ff/ff/ff'
|
||||
# new_bg='#232729'
|
||||
# new_bg='black'
|
||||
# new_bg='00/00/00'
|
||||
BRIGHTNESS=20
|
||||
TERM_BACKGROUND=dark
|
||||
;;
|
||||
esac
|
||||
|
||||
(
|
||||
[[ -z "$KITTY_ONLY" ]] && {
|
||||
# brightnessctl set $BRIGHTNESS
|
||||
|
||||
## look for an emacs running as this user:
|
||||
#emacs_pid=$(pgrep -u $USER emacs | head -n 1)
|
||||
#[[ "$emacs_pid" ]] && emacsclient --eval "
|
||||
# (progn
|
||||
# (mapcar 'disable-theme custom-enabled-themes)
|
||||
# (load-theme '$new_emacs_theme t))"
|
||||
##(load-theme '$new_emacs_modeline_theme))"
|
||||
|
||||
f=~/.gtkrc-2.0
|
||||
[[ -w $f ]] && {
|
||||
sed -i "s/^gtk-theme-name=.*/gtk-theme-name=\"$new_gtk_theme\"/" $f
|
||||
sed -i "s/^gtk-icon-theme-name=.*/gtk-icon-theme-name=\"$new_icon_theme\"/" $f
|
||||
sed -i "s/^gtk-cursor-theme-name=.*/gtk-cursor-theme-name=\"$new_cursor_theme\"/" $f
|
||||
}
|
||||
|
||||
# gtkreload # gtk2 only!
|
||||
|
||||
# if ! command -v nvr &> /dev/null
|
||||
# then
|
||||
# echo "nvr not installed"
|
||||
# elif [ "$(pgrep nvim)" != "" ]; then
|
||||
# echo "new theme $new_nvim_theme"
|
||||
# nvr --nostart --remote-send ":colorscheme $new_nvim_theme<CR>"
|
||||
# exit
|
||||
# fi
|
||||
|
||||
|
||||
f=~/.config/gtk-3.0/settings.ini
|
||||
[[ -w $f ]] && {
|
||||
sed -i "s/^gtk-theme-name=.*/gtk-theme-name=$new_gtk_theme/" $f
|
||||
sed -i "s/^gtk-icon-theme-name=.*/gtk-icon-theme-name=$new_icon_theme/" $f
|
||||
sed -i "s/^gtk-cursor-theme-name=.*/gtk-cursor-theme-name=$new_cursor_theme/" $f
|
||||
}
|
||||
|
||||
# /usr/libexec/gsd-xsettings notifies gtk3 clients - start it in sway
|
||||
|
||||
# these two appear to be completely equivalent:
|
||||
dconf write /org/gnome/desktop/interface/gtk-theme "'$new_gtk_theme'"
|
||||
gsettings set org.gnome.desktop.interface gtk-theme $new_gtk_theme
|
||||
gsettings set org.gnome.desktop.interface color-scheme "prefer-$TERM_BACKGROUND"
|
||||
|
||||
dconf write /org/gnome/desktop/interface/icon-theme "'$new_icon_theme'"
|
||||
dconf write /org/gnome/desktop/interface/cursor-theme "'$new_cursor_theme'"
|
||||
|
||||
f=~/.config/qt5ct/qt5ct.conf
|
||||
[[ -w $f ]] && {
|
||||
sed -i "s/^style=.*/style=$new_gtk_theme/" $f
|
||||
sed -i "s/^icon-theme=.*/style=$new_icon_theme/" $f
|
||||
# cursor?
|
||||
}
|
||||
}
|
||||
|
||||
# requires this in ~/.config/kitty/kitty.conf:
|
||||
# allow_remote_control yes
|
||||
# listen_on unix:/tmp/kitty-socket
|
||||
kitty +kitten themes --cache-age=-1 --reload-in=all $new_kitty_theme
|
||||
# for SOCK in /tmp/kitty-socket-*; do
|
||||
# if [[ -r $new_kitty_theme ]]; then
|
||||
# else
|
||||
# # this should work for all terms:
|
||||
# for TERM in /dev/pts/[0-9]*; do
|
||||
# if [[ -O $TERM ]]; then
|
||||
# {
|
||||
# printf "\\033]10;rgb:$new_fg\\033\\\\"
|
||||
# printf "\\033]11;rgb:$new_bg\\033\\\\"
|
||||
# } >$TERM
|
||||
# fi
|
||||
# done
|
||||
# # kitty @ --to=unix:$SOCK set_colors --all foreground=$new_fg background=$new_bg
|
||||
# fi
|
||||
# done
|
||||
|
||||
# for 'low-power' script:
|
||||
echo $TERM_BACKGROUND > $DARK_MODE_STATUS_FILE
|
||||
) >/dev/null
|
||||
|
||||
# echo "TERM_BACKGROUND=$TERM_BACKGROUND; setup_prompt"
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# time-stamp-pattern: "4/TIME_STAMP=\"%:y%02m%02d.%02H%02M%02S\""
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# End:
|
22
.config/waybar/scripts/toggle-hdpi
Executable file
22
.config/waybar/scripts/toggle-hdpi
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
CURRENT=$(swaymsg -t get_outputs --raw | jq '.[] | [.current_mode.width, .current_mode.height] | join("x")')
|
||||
|
||||
HIGH="ﳍ"
|
||||
STANDARD="ﳭ"
|
||||
|
||||
if [ "$CURRENT" = '"3840x2160"' ]; then
|
||||
if [ "$1" = "--toggle" ]; then
|
||||
swaymsg "output eDP-1 mode --custom 1920x1080@60Hz"
|
||||
killall waybar
|
||||
nohup waybar
|
||||
fi
|
||||
echo $HIGH
|
||||
elif [ "$CURRENT" = '"1920x1080"' ]; then
|
||||
if [ "$1" = "--toggle" ]; then
|
||||
swaymsg "output eDP-1 mode --custom 3840x2160@60Hz"
|
||||
killall waybar
|
||||
nohup waybar
|
||||
fi
|
||||
echo $STANDARD
|
||||
fi
|
||||
|
21
.config/waybar/scripts/toggle-theme
Executable file
21
.config/waybar/scripts/toggle-theme
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
DARK_MODE_STATUS_FILE=~/.cache/dark-mode
|
||||
CURRENT_DARK_MODE=$( cat $DARK_MODE_STATUS_FILE )
|
||||
|
||||
LIGHT="盛"
|
||||
DARK=""
|
||||
|
||||
if [ "$1" == "--toggle" ]; then
|
||||
if [ $CURRENT_DARK_MODE == "light" ]; then
|
||||
~/.config/waybar/scripts/set-theme dark
|
||||
else
|
||||
~/.config/waybar/scripts/set-theme light
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $CURRENT_DARK_MODE != "light" ]; then
|
||||
echo $DARK
|
||||
else
|
||||
echo $LIGHT
|
||||
fi
|
Reference in New Issue
Block a user