1
0
mirror of https://github.com/frebib/dotfiles.git synced 2024-06-14 12:57:23 +00:00

Compare commits

...

11 Commits

Author SHA1 Message Date
4a646b6573
aliases: scp is always recursive
This should be the default >.<
2020-03-22 12:46:26 +00:00
37ad234319
aliases: add ginit alias 2020-03-22 12:46:07 +00:00
5547ec844c
i3/powermenu: add pretty icons 2020-03-22 12:44:57 +00:00
934944d248
i3: don't stop desktop on restart
This allows restarting the i3 process without killing the session
2020-03-22 12:36:50 +00:00
ec0b562960
picom: log info; reduce excessive log spam 2020-03-22 12:36:06 +00:00
028c549ea9
polybar: delay before closing yay window
To give the user enough time to actually read the output
2020-03-22 12:35:49 +00:00
96902aee6b
X11: don't fail xprofile when xmodmap is absent 2020-03-22 12:35:16 +00:00
c495293fb7
i3/powermenu: exit systemd session on logout 2020-03-22 12:34:05 +00:00
9aeeee58d0
i3: launch i3 programs with systemd
This parents each program within it's own service/scope to the systemd user session, independent of i3
2020-03-22 12:33:26 +00:00
8e86599372
i3/powermenu: fix rebooting when non-interactive 2020-03-22 12:32:00 +00:00
4b52c21ac9
alacritty: set alacritty as default terminal 2020-03-22 11:10:14 +00:00
9 changed files with 57 additions and 35 deletions

View File

@ -1,7 +1,7 @@
#!/bin/sh -u #!/bin/sh -u
# Graphical-specific environment variables # Graphical-specific environment variables
export TERMINAL="termite" export TERMINAL="alacritty"
export BROWSER="firefox" export BROWSER="firefox"
export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel" export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel"
@ -19,4 +19,6 @@ xrandr --dpi $(xrdb -query | grep -i xft.dpi | cut -d: -f2)
setxkbmap -option caps:none setxkbmap -option caps:none
xset r rate 200 18 xset r rate 200 18
xmodmap "$XDG_CONFIG_HOME"/X11/xmodmap
test -f "$XDG_CONFIG_HOME"/X11/xmodmap && \
xmodmap "$XDG_CONFIG_HOME"/X11/xmodmap

View File

@ -113,10 +113,9 @@ exec_always --no-startup-id feh --no-fehbg --no-xinerama --bg-fill $DOTFILES/lak
for_window [class="Pinentry"] floating enable for_window [class="Pinentry"] floating enable
for_window [class="Pavucontrol"] floating enable for_window [class="Pavucontrol"] floating enable
for_window [class="Blueman-manager"] floating enable for_window [class="Blueman-manager"] floating enable
for_window [class="floating-term" instance="termite"] floating enable
for_window [class="Alacritty" instance="floating-term"] floating enable
for_window [window_role="floating-term"] floating enable for_window [window_role="floating-term"] floating enable
for_window [window_role="pop-up"] floating enable
for_window [window_role="i3blocks-update-term"] floating enable
for_window [window_role="i3blocks-clock-term"] floating enable
for_window [title="^rofi$"] floating enable for_window [title="^rofi$"] floating enable
new_window none new_window none
@ -130,26 +129,27 @@ popup_during_fullscreen smart
# keybindings # keybindings
bindsym $mod+Shift+j reload bindsym $mod+Shift+j reload
bindsym $mod+c exec systemd-run --user --scope --slice=chromium.slice --no-block -- chromium bindsym $mod+c exec notify-send "Try again" "You meant \\\$mod+b"
bindsym $mod+b exec systemd-run --user --scope --slice=firefox.slice --no-block -- firefox bindsym $mod+b exec systemd-run-i3 -c -s firefox firefox
bindsym $mod+v exec "i3-sensible-terminal -e \\"$SHELL -c vim;$SHELL\\" bindsym $mod+v exec systemd-run-i3 i3-sensible-terminal -e sh -c "($SHELL -c $EDITOR || :) && $SHELL"
bindsym $mod+Ctrl+v exec "i3-sensible-terminal -r floating-term -e \\"$SHELL -c vim;$SHELL\\" bindsym $mod+Ctrl+v exec systemd-run-i3 i3-sensible-terminal --class floating-term -e sh -c "($SHELL -c $EDITOR || : ) && $SHELL"
bindsym $mod+Return exec i3-sensible-terminal bindsym $mod+Return exec systemd-run-i3 i3-sensible-terminal
bindsym $mod+Ctrl+Return exec i3-sensible-terminal -r floating-term bindsym $mod+Ctrl+Return exec systemd-run-i3 i3-sensible-terminal --class floating-term
bindsym $mod+Shift+Return exec i3-sensible-terminal -d "`xcwd`" bindsym $mod+Shift+Return exec systemd-run-i3 i3-sensible-terminal --working-directory "$(xcwd)"
bindsym $mod+Ctrl+Shift+Return exec i3-sensible-terminal -r floating-term -d "`xcwd`" bindsym $mod+Ctrl+Shift+Return exec systemd-run-i3 i3-sensible-terminal --class floating-term --working-directory "$(xcwd)"
bindsym $mod+l exec dm-tool switch-to-greeter bindsym $mod+l exec dm-tool switch-to-greeter
bindsym $mod+space exec "pkill rofi; rofi -show run -sidebar-mode -terminal i3-sensible-terminal -normal-window" bindsym $mod+space exec rofi -show run -sidebar-mode -terminal i3-sensible-terminal -normal-window -run-command 'systemd-run-i3 -n {cmd}'
bindsym $mod+Shift+p exec rofi-pass --root $(grep path ~/.config/gopass/config.yml | sed -E 's|^.*fs\+file://||g' | tr '\n' ':') | sed 's/:$//g' bindsym $mod+Shift+p exec rofi-pass --root $(grep path ~/.config/gopass/config.yml | sed -E 's|^.*fs\+file://||g' | tr '\n' ':') | sed 's/:$//g'
bindsym $mod+Shift+e exec rofi-emoji bindsym $mod+Shift+e exec systemd-run-i3 -n rofi-emoji
bindsym $mod+Shift+i exec rofi-fontawesome bindsym $mod+Shift+i exec systemd-run-i3 -n rofi-fontawesome
bindsym --release Print exec screenshot bindsym --release Print exec systemd-run-i3 -n screenshot
bindsym --release $mod+Print exec imgur-screenshot bindsym --release $mod+Print exec systemd-run-i3 -n imgur-screenshot
bindsym $mod+$alt+space exec --no-startup-id ~/.config/i3/cycleaudio.py && pkill -RTMIN+10 i3blocks bindsym $mod+x exec systemd-run-i3 -n i3-sensible-terminal --class floating-term --hold -e /bin/echo "$(xprop -id $(xdotool getactivewindow))"
bindsym $mod+numbersign exec "i3-sensible-terminal -e 'sh -c xclip\ -o\ |\ gpg\ --decrypt\ 2>&1\ \;\ $SHELL'" bindsym $mod+$alt+space exec systemd-run-i3 -n ~/.config/i3/cycleaudio.py && pkill -RTMIN+10 i3blocks
bindsym $mod+r exec "bash -c 'pwgen -nc 32 1 | tee >(xargs notify-send Generated\ password\:) | xclip -i'" bindsym $mod+numbersign exec systemd-run-i3 -n i3-sensible-terminal --hold -e sh -c 'xclip -o | gpg --decrypt 2>&1'
bindsym $mod+g exec "LINK=$(gist -PRpc); notify-send -c transfer \\"$LINK\\"" bindsym $mod+r exec systemd-run-i3 -n bash -c 'pwgen -nc 32 1 | tee >(xargs notify-send Generated\ password\:) | xclip -i'
bindsym --release $mod+i exec sh -c 'sleep 0.5 && xdotool type --delay 400 "$(xclip -o -selection clipboard)"' bindsym $mod+g exec systemd-run-i3 -n notify-send -c transfer "$(gist -PRpc)"
bindsym --release $mod+i exec systemd-run-i3 -n sh -c 'sleep 0.5 && xdotool type --delay 400 "$(xclip -o -selection clipboard)"'
# Media player controls # Media player controls
bindsym XF86AudioPlay exec --no-startup-id playerctl -a play-pause bindsym XF86AudioPlay exec --no-startup-id playerctl -a play-pause

View File

@ -1,10 +1,11 @@
#!/bin/sh #!/bin/sh
option=$(echo "lock|logout|sleep|hibernate|power off|reboot|windows" | rofi -sep "|" -dmenu -i -p "" -auto-select -hide-scrollbar -monitor 0 -width 10 -lines 7 -location 3 -tokenize false -matching normal | xargs) option="$(echo " lock| logout| sleep| hibernate| power off| reboot| windows" | \
rofi -sep "|" -dmenu -i -p "" -auto-select -hide-scrollbar -monitor 0 -width 10 -lines 7 -location 3 -tokenize false -matching normal | cut -d' ' -f2- | xargs)"
case $option in case $option in
lock) dm-tool switch-to-greeter;; lock) dm-tool switch-to-greeter;;
logout) i3-msg exit;; logout) systemctl --user exit;;
sleep) systemctl suspend;; sleep) systemctl suspend;;
hibernate) systemctl hibernate;; hibernate) systemctl hibernate;;
power\ off) systemctl poweroff;; power\ off) systemctl poweroff;;
@ -12,7 +13,5 @@ case $option in
windows) windows)
windows=`efibootmgr | grep -Po -m1 'Boot\K(\d{4}).*Windows.*' | head -c4` windows=`efibootmgr | grep -Po -m1 'Boot\K(\d{4}).*Windows.*' | head -c4`
sudo efibootmgr -n $windows sudo efibootmgr -n $windows
sudo hibereboot;; reboot;;
esac esac
exit 0

View File

@ -1,5 +1,5 @@
# Logging # Logging
log-level = "debug"; log-level = "info";
#log-file = "/home/frebib/.local/share/picom.log"; #log-file = "/home/frebib/.local/share/picom.log";
# Shadow # Shadow

View File

@ -68,13 +68,13 @@ exec = $XDG_CONFIG_HOME/polybar/update.sh
tail = true tail = true
format-prefix = " " format-prefix = " "
format-prefix-foreground = ${colours.icon} format-prefix-foreground = ${colours.icon}
click-left = systemd-run --user --no-block -- i3-sensible-terminal -r i3blocks-update-term -e "sh -c 'yay && kill -USR1 %pid% || kill --USR1 %pid%'" click-left = systemd-run --user --no-block -- i3-sensible-terminal --class floating-term -e sh -c "yay; kill -USR1 %pid%; sleep 1"
[module/weather] [module/weather]
type = custom/script type = custom/script
exec = $XDG_CONFIG_HOME/polybar/weather.sh exec = $XDG_CONFIG_HOME/polybar/weather.sh
interval = 120 interval = 120
click-left = systemd-run --user --no-block i3-sensible-terminal -r floating-term -e 'sh -c "xdotool getactivewindow windowsize 910 680 && curl wttr.in && sleep infinity"' click-left = systemd-run --user --no-block -- i3-sensible-terminal --class floating-term -d 125 40 --hold -e sh -c "curl wttr.in"
[module/gateway] [module/gateway]
type = custom/script type = custom/script
@ -208,7 +208,7 @@ label-disconnected-foreground = ${colours.critical}
type = internal/date type = internal/date
interval = 1 interval = 1
label = %{A3:systemd-run --user --no-block -- i3-sensible-terminal -r i3blocks-clock-term -e "sh -c \"xdotool getactivewindow windowsize 500 600; cal -y $(date +%Y); stty -echo; exec sleep infinity\"" &:}%date% %time%%{A} label = %{A3:systemd-run --user --no-block -- i3-sensible-terminal --class floating-term -d 66 35 -qq --hold -e sh -c "cal -y $(date +%Y)":}%date% %time%%{A}
time = %H:%M time = %H:%M
time-alt = %a %e %b %Y %H:%M:%S time-alt = %a %e %b %Y %H:%M:%S

View File

@ -7,7 +7,6 @@ After=profile.service xprofile.service xorg.target
[Service] [Service]
ExecStart=/usr/bin/i3 ExecStart=/usr/bin/i3
ExecReload=/bin/sh -c 'i3-msg restart; systemctl is-active --user -q picom && systemctl --user restart picom' ExecReload=/bin/sh -c 'i3-msg restart; systemctl is-active --user -q picom && systemctl --user restart picom'
ExecStop=/bin/systemctl --user stop desktop.target
Restart=always Restart=always
[Install] [Install]

View File

@ -7,7 +7,7 @@ After=xorg.target profile.service
[Service] [Service]
Type=oneshot Type=oneshot
RemainAfterExit=yes RemainAfterExit=yes
ExecStart=/usr/bin/bash -cx '. $XDG_CONFIG_HOME/X11/xprofile && systemctl --user import-environment' ExecStart=/usr/bin/bash -c '. $XDG_CONFIG_HOME/X11/xprofile; systemctl --user import-environment'
[Install] [Install]
WantedBy=xorg.target WantedBy=xorg.target

View File

@ -60,6 +60,7 @@ alias open=xdg-open
alias rm='rm -i' alias rm='rm -i'
alias mv='mv -i' alias mv='mv -i'
alias cp='cp -ir' alias cp='cp -ir'
alias scp='scp -r'
alias dd='dd status=progress' alias dd='dd status=progress'
alias ssh="ssh -tt" alias ssh="ssh -tt"
alias wget="wget --hsts-file=$XDG_DATA_HOME/wget/hsts-file" alias wget="wget --hsts-file=$XDG_DATA_HOME/wget/hsts-file"
@ -116,6 +117,7 @@ alias chx='chmod +x'
# Git Aliases # Git Aliases
alias g=git alias g=git
alias ginit='git init'
alias gignore='$EDITOR .gitignore' alias gignore='$EDITOR .gitignore'
alias gitc='$EDITOR $XDG_CONFIG_HOME/git/config' alias gitc='$EDITOR $XDG_CONFIG_HOME/git/config'
alias ggignore='$EDITOR $XDG_CONFIG_HOME/git/gitignore' alias ggignore='$EDITOR $XDG_CONFIG_HOME/git/gitignore'

20
scripts/systemd-run-i3 Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash -e
args=()
while getopts "u:s:e:d:cnw" opt
do case "$opt" in
u) args+=("--unit=$OPTARG");;
s) args+=("--slice=$OPTARG");;
e) args+=("--setenv=$OPTARG");;
d) args+=("--working-directory=$OPTARG");;
c) args+=("--scope");;
n) args+=("--no-block");;
w) args+=("--wait");;
*) shift;;
esac
done
shift $((OPTIND-1))
rand=$(tr -dc 'a-f0-9' < /dev/urandom | head -c 16)
exec systemd-run --user --collect ${args[@]} --unit="$1-$rand" -- "$@"