This commit is contained in:
cho 2023-07-02 16:41:21 +07:00
parent 20e21fbc3a
commit b8a16186ab
13 changed files with 164 additions and 33 deletions

1
.gitignore vendored
View File

@ -8,3 +8,4 @@ home/default/.config/mpd/sticker.sql
home/default/.config/mpd/mpd.state
home/default/.config/gtk-3.0/bookmarks
home/default/.config/zsh/.zcompdump
home/default/.local/bin/start-tasks

View File

@ -0,0 +1,12 @@
[Unit]
Description=Control Radeon Card
After=getty.target
[Service]
Restart=on-failure
Type=simple
RestartSec=10
ExecStart=/usr/local/bin/radcard-autoset.sh
[Install]
WantedBy=multi-user.target

View File

@ -2,8 +2,8 @@
# Any customization should be done in ~/.gtkrc-2.0.mine instead.
include "/home/default/.gtkrc-2.0.mine"
gtk-theme-name="Adwaita-dark"
gtk-icon-theme-name="hicolor"
gtk-theme-name="Materia-dark"
gtk-icon-theme-name="Papirus-Dark"
gtk-font-name="Sans 10"
gtk-cursor-theme-name="Adwaita"
gtk-cursor-theme-size=0

View File

@ -13,3 +13,4 @@ gtk-enable-input-feedback-sounds=1
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle=hintfull
gtk-application-prefer-dark-theme=1

View File

@ -0,0 +1,34 @@
#!/bin/sh
# todo: import to wayland
while read -r file
do
case "$1" in
"w") change-background "$file" & ;;
"c")
[ -z "$destdir" ] && destdir="$(sed "s/#.*$//;/^\s*$/d" ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | awk '{print $2}' | rofi -dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")"
[ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit
cp "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file copied to $destdir." &
;;
"m")
[ -z "$destdir" ] && destdir="$(sed "s/#.*$//;/^\s*$/d" ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | awk '{print $2}' | rofi -dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")"
[ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit
mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." &
;;
"r")
convert -rotate 90 "$file" "$file" ;;
"R")
convert -rotate -90 "$file" "$file" ;;
"f")
convert -flop "$file" "$file" ;;
"y")
printf "%s" "$file" | tr -d '\n' | xclip -selection clipboard &&
notify-send "$file copied to clipboard" & ;;
"Y")
readlink -f "$file" | tr -d '\n' | xclip -selection clipboard &&
notify-send "$(readlink -f "$file") copied to clipboard" & ;;
"d")
[ "$(printf "No\\nYes" | rofi -dmenu -i -p "Really delete $file?")" = "Yes" ] && rm "$file" && notify-send "$file deleted." ;;
"g") setsid -f gimp "$file" ;;
"i") notify-send "File information" "$(mediainfo "$file" | sed "s/[ ]\+:/:/g;s/: /: <b>/;s/$/<\/b>/" | grep "<b>")" ;;
esac
done

View File

@ -1,5 +1,6 @@
### sway settings
# logo key. Use Mod1 for Alt.
set $mod Mod4
@ -49,8 +50,8 @@ exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
# emacs daemon
exec /usr/bin/emacs --daemon
#assign [app_id="librewolf"] 2
#assign [app_id="firefox"] 2
assign [app_id="librewolf"] 2
assign [app_id="firefox"] 2
assign [app_id="mumble"] 9
assign [app_id="dino"] 9
assign [app_id="deluge"] 10
@ -83,6 +84,13 @@ client.focused_inactive $cl_back $cl_back $cl_fore $cl_back $cl_back
client.unfocused $cl_back $cl_back $cl_fore $cl_back $cl_back
client.urgent $cl_urge $cl_urge $cl_fore $cl_urge $cl_urge
set $gnome-schema org.gnome.desktop.interface
exec_always {
gsettings set $gnome-schema gtk-theme 'Materia-dark'
gsettings set $gnome-schema icon-theme 'Papirus-Dark'
gsettings set $gnome-schema color-scheme 'prefer-dark'
}
### Idle configuration
# timeout
@ -146,16 +154,19 @@ bindsym $mod+Shift+u exec grimshot save window $HOME/Pictures/Screenshots/$(date
### programs
# sway config
# files
bindsym $mod+F1 exec em ~/.config/sway/config
bindsym $mod+F2 exec em ~/.dotroot/packages.txt
bindsym $mod+F3 exec em ~/.dotroot/instructions.org
bindsym $mod+F4 exec em ~/notebook/studies/college.org
bindsym $mod+F5 exec em ~/notebook/ag/habits.org
bindsym $mod+F6 exec em ~/notebook/ag/agenda.org
# browser
bindsym $mod+w exec $browser
# agenda
bindsym $mod+c exec emacsclient -c --eval '(org-agenda-list)' || emacs --eval '(org-agenda-list)'
bindsym $mod+c exec emacsclient --eval '(org-agenda-list)' || emacs --eval '(org-agenda-list)'
# notebook
bindsym $mod+n exec $term -e $editor ~/notebook/index.org

View File

@ -1,3 +0,0 @@
[dotfiles]
repository = ~/.dotfiles
packages = ['.config', '.local/share/applications', '.local/bin']

View File

@ -1,2 +1,2 @@
#!/bin/sh
setsid -f emacsclient --create-frame --alternate-editor='emacs' $@ >/dev/null 2>&1
setsid -f emacsclient --alternate-editor='emacs' $@ >/dev/null 2>&1

View File

@ -7,7 +7,7 @@ case "$(readlink -f /sbin/init)" in
*) ctl='loginctl' ;;
esac
case "$(printf "🔒 lock\n🚪 leave $WM\n♻ renew $WM\n🐻 hibernate\n🔃 reboot\n🖥 shutdown\n💤 sleep\n📺 display off\n set background\n start idle\n kill swayidle\n fcitx5\n kill fcitx5\n start emacs daemon\n kill emacs daemon\n restart emacs daemon" | dmenu -i -l 16 -p 'Action: ')" in
case "$(printf "🔒 lock\n🚪 leave $WM\n♻ renew $WM\n🐻 hibernate\n🔃 reboot\n🖥 shutdown\n💤 sleep\n📺 display off\n set background\n start idle\n kill swayidle\n fcitx5\n kill fcitx5\n start emacs daemon\n kill emacs daemon\n restart emacs daemon" | rofi -dmenu -i -l 16 -p 'Action: ')" in
'🔒 lock')
setsid -f swaylock
setsid -f sleep 2 && swayidle -w timeout 1 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on" && kill $#'

View File

@ -0,0 +1,4 @@
[Desktop Entry]
Type=Application
Name=Whatsapp
Exec=/usr/bin/librewolf -P wa https://web.whatsapp.com

View File

@ -93,6 +93,10 @@ sudo dnf config-manager --add-repo https://rpm.librewolf.net/librewolf-repo.repo
sudo dnf install librewolf
#+END_SRC
*** plugins, etc
https://github.com/ranmaru22/firefox-vertical-tabs
https://addons.mozilla.org/en-US/firefox/addon/multi-account-containers/
** doom emacs
first we need marked for markdown support
@ -174,6 +178,13 @@ sudo dnf copr enable marcusmueller/sc-im
sudo dnf install sc-im
#+END_SRC
** nsxiv (image viewer)
#+BEGIN_SRC sh
dnf copr enable mamg22/nsxiv
dnf install nsxiv
#+END_SRC
** pip
*** keepmenu (dmenu keepassxc client)
@ -182,6 +193,12 @@ https://github.com/firecat53/keepmenu/blob/main/docs/install.md#install-recommen
pip install --user keepmenu
#+END_SRC
*** pulsemixer (pulseaudio controller)
#+BEGIN_SRC sh
pip install --user pulsemixer
#+END_SRC
** go packages
*** pup
@ -280,34 +297,21 @@ curl https://sh.rustup.rs -sSf | sh
** other
*** crashes with wayland under amd gpus
this happens on my machine. changing kernel to improves this issue, but it does still happen infrequently. may have to do with gpu drivers.
see https://bbs.archlinux.org/viewtopic.php?id=270468
https://forum.manjaro.org/t/graphics-glitches-freeze-up-with-new-comp-error-ring-gfx-timeout/55979/6
#+BEGIN_SRC sh
sudo dnf install 'dnf-command(versionlock)'
# create a temporary directory
mkdir /tmp/kernel && cd /tmp/kernel
# get packages
wget https://kojipkgs.fedoraproject.org/packages/kernel/6.0.14/300.fc37/x86_64/kernel-6.0.14-300.fc37.x86_64.rpm https://kojipkgs.fedoraproject.org/packages/kernel/6.0.14/300.fc37/x86_64/kernel-core-6.0.14-300.fc37.x86_64.rpm https://kojipkgs.fedoraproject.org/packages/kernel/6.0.14/300.fc37/x86_64/kernel-devel-6.0.14-300.fc37.x86_64.rpm https://kojipkgs.fedoraproject.org/packages/kernel/6.0.14/300.fc37/x86_64/kernel-modules-6.0.14-300.fc37.x86_64.rpm
# install them
sudo dnf install *.rpm
# lock them in their versions
sudo dnf versionlock add kernel-0:6.0.14-300.fc37 kernel-core-0:6.0.14-300.fc37 kernel-devel-0:6.0.14-300.fc37 kernel-modules-0:6.0.14-300.fc37
sudo cp ~/.dots/usr/local/bin/radcard* /usr/local/bin/
sudo cp ~/.dots/etc/systemd/system/radcard.service /etc/systemd/system/
sudo systemctl enable --now radcard.service
#+END_SRC
using sway 1.7 alongside the kernel seems to fix this (will update later if it works)
#+BEGIN_SRC sh
wget https://kojipkgs.fedoraproject.org/packages/sway/1.7/2.fc37/x86_64/sway-1.7-2.fc37.x86_64.rpm
# sway-config-upstream doesn't exist for sway 1.7-2
sudo dnf install sway-1.7-2.fc37.x86_64.rpm --allowerasing
sudo dnf versionlock sway-1.7-2.fc37
you can check the status with `radcard.sh get` , make sure the output is as follows:
#+BEGIN_SRC
power_dpm_state: performance
power_dpm_force_performance_level: high
#+END_SRC
* todos
** add packages
*** TODO add simple-mtpfs

View File

@ -0,0 +1,3 @@
#!/bin/sh
echo performance > /sys/class/drm/card1/device/power_dpm_state
echo high > /sys/class/drm/card1/device/power_dpm_force_performance_level

64
usr/local/bin/radcard.sh Executable file
View File

@ -0,0 +1,64 @@
#!/bin/bash
# Radcard
# Script to control radeon DPM power saving
# Ref: https://wiki.archlinux.org/index.php/ATI#Powersaving
# Version: 2019-02-12
# License: GPLv3
# Authors: jamie.bainbridge@gmail.com
CARDPATH="/sys/class/drm/card1/device"
do_set() {
case "$1" in
bat*)
sudo sh -c "echo battery > $CARDPATH/power_dpm_state"
;;
bal*)
sudo sh -c "echo balanced > $CARDPATH/power_dpm_state"
;;
per*)
sudo sh -c "echo performance > $CARDPATH/power_dpm_state"
;;
a*)
sudo sh -c "echo auto > $CARDPATH/power_dpm_force_performance_level"
;;
l*)
sudo sh -c "echo low > $CARDPATH/power_dpm_force_performance_level"
;;
h*)
sudo sh -c "echo high > $CARDPATH/power_dpm_force_performance_level"
;;
*)
do_usage
;;
esac
}
do_get() {
echo -n "power_dpm_state: "; cat "$CARDPATH/power_dpm_state"
echo -n "power_dpm_force_performance_level: "; cat "$CARDPATH/power_dpm_force_performance_level"
}
do_usage() {
echo "Usage: $(basename "$0") [get|set [battery|balanced|performance|auto|low|high|bat|bal|per|a|h|l]]"
exit 1
}
case "$1" in
"set")
shift
for VAR in "$@"; do
do_set "$VAR"
done
do_get
;;
"get")
do_get
;;
*)
do_usage
;;
esac
exit 0