mirror of
https://github.com/frebib/dotfiles.git
synced 2024-06-14 12:57:23 +00:00
dotfiles: move .config/* to root
This seems to make more sense. Almost all files were within .config anyway. Signed-off-by: Joe Groocock <me@frebib.net>
This commit is contained in:
168
i3/config
Normal file
168
i3/config
Normal file
@ -0,0 +1,168 @@
|
||||
# i3 config file (v4)
|
||||
#
|
||||
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
|
||||
|
||||
set $mod Mod4
|
||||
set $alt Mod1
|
||||
floating_modifier $mod
|
||||
|
||||
font pango:sans 9
|
||||
|
||||
# kill focused window
|
||||
bindsym $mod+apostrophe kill
|
||||
bindsym $alt+F4 kill
|
||||
|
||||
# change window focus
|
||||
bindsym $mod+d focus left
|
||||
bindsym $mod+h focus down
|
||||
bindsym $mod+t focus up
|
||||
bindsym $mod+n focus right
|
||||
|
||||
# move focused window
|
||||
bindsym $mod+Shift+d move left
|
||||
bindsym $mod+Shift+h move down
|
||||
bindsym $mod+Shift+t move up
|
||||
bindsym $mod+Shift+n move right
|
||||
|
||||
# split in horizontal orientation
|
||||
bindsym $mod+m split h
|
||||
bindsym $mod+w split v
|
||||
|
||||
# enter fullscreen mode for the focused container
|
||||
bindsym $mod+Shift+f fullscreen toggle global
|
||||
bindsym $mod+f fullscreen toggle
|
||||
|
||||
# change container layout (stacked, tabbed, toggle split)
|
||||
bindsym $mod+p layout stacking
|
||||
bindsym $mod+comma layout tabbed
|
||||
bindsym $mod+period layout toggle split
|
||||
|
||||
# toggle tiling / floating
|
||||
bindsym $mod+u floating toggle
|
||||
bindsym $mod+e sticky toggle
|
||||
|
||||
# focus the parent container
|
||||
bindsym $mod+a focus parent
|
||||
bindsym $mod+o focus child
|
||||
|
||||
# Screen configs #
|
||||
set $bl "DP-5"
|
||||
set $tl "DP-1"
|
||||
set $br "HDMI-0"
|
||||
set $tr "DP-3"
|
||||
|
||||
# Workspace -> Screen
|
||||
workspace 1 output $bl
|
||||
workspace 2 output $br
|
||||
workspace 3 output $tl
|
||||
workspace 4 output $tr
|
||||
workspace 5 output $bl
|
||||
workspace 6 output $br
|
||||
workspace 7 output $tl
|
||||
workspace 8 output $tr
|
||||
|
||||
# switch to workspace
|
||||
bindsym $mod+1 workspace 1
|
||||
bindsym $mod+2 workspace 2
|
||||
bindsym $mod+3 workspace 3
|
||||
bindsym $mod+4 workspace 4
|
||||
bindsym $mod+5 workspace 5
|
||||
bindsym $mod+6 workspace 6
|
||||
bindsym $mod+7 workspace 7
|
||||
bindsym $mod+8 workspace 8
|
||||
bindsym $mod+9 workspace 9
|
||||
bindsym $mod+0 workspace 10
|
||||
|
||||
# move workspaces across screens
|
||||
bindsym $mod+$alt+d move workspace to output left
|
||||
bindsym $mod+$alt+n move workspace to output right
|
||||
bindsym $mod+$alt+t move workspace to output up
|
||||
bindsym $mod+$alt+h move workspace to output down
|
||||
|
||||
# move focused container to workspace
|
||||
bindsym $mod+Shift+1 move container to workspace 1
|
||||
bindsym $mod+Shift+2 move container to workspace 2
|
||||
bindsym $mod+Shift+3 move container to workspace 3
|
||||
bindsym $mod+Shift+4 move container to workspace 4
|
||||
bindsym $mod+Shift+5 move container to workspace 5
|
||||
bindsym $mod+Shift+6 move container to workspace 6
|
||||
bindsym $mod+Shift+7 move container to workspace 7
|
||||
bindsym $mod+Shift+8 move container to workspace 8
|
||||
bindsym $mod+Shift+9 move container to workspace 9
|
||||
bindsym $mod+Shift+0 move container to workspace 10
|
||||
|
||||
# opens logout/shutdown menu
|
||||
bindsym $mod+Shift+Escape exec --no-startup-id ~/.config/i3/powermenu.sh
|
||||
|
||||
set $bg-color #2f343f
|
||||
set $inactive-bg-color #2f343f
|
||||
set $text-color #f3f4f5
|
||||
set $inactive-text-color #676E7D
|
||||
set $urgent-bg-color #E53935
|
||||
|
||||
# window colors
|
||||
# border background text indicator
|
||||
client.focused $bg-color $bg-color $text-color $bg-color
|
||||
client.unfocused $inactive-bg-color $inactive-bg-color $inactive-text-color $bg-color
|
||||
client.focused_inactive $inactive-bg-color $inactive-bg-color $inactive-text-color $bg-color
|
||||
client.urgent $urgent-bg-color $urgent-bg-color $text-color $bg-color
|
||||
|
||||
exec_always --no-startup-id feh --no-fehbg --no-xinerama --bg-fill $DOTFILES/lakesidesunrise.jpg
|
||||
|
||||
# Window rules
|
||||
for_window [class="Pinentry"] floating enable
|
||||
for_window [class="Pavucontrol"] 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 [class="^jetbrains-.+$" title="win0"] floating enable
|
||||
for_window [window_role="floating-term"] floating enable
|
||||
for_window [title="^rofi$"] floating enable
|
||||
|
||||
new_window none
|
||||
new_float none
|
||||
|
||||
gaps inner 24
|
||||
gaps outer 4
|
||||
|
||||
focus_follows_mouse yes
|
||||
popup_during_fullscreen smart
|
||||
|
||||
# keybindings
|
||||
bindsym $mod+Shift+j reload
|
||||
bindsym --release $mod+x exec xkill
|
||||
bindsym $mod+c exec notify-send "Try again" "You meant \\\$mod+b"
|
||||
bindsym $mod+b exec systemd-run-i3 -c -s firefox firefox
|
||||
bindsym $mod+Return exec systemd-run-i3 -n alacritty
|
||||
bindsym $mod+Ctrl+Return exec systemd-run-i3 -n alacritty --class floating
|
||||
bindsym $mod+Shift+Return exec systemd-run-i3 -n alacritty --working-directory "$(xcwd)"
|
||||
bindsym $mod+Ctrl+Shift+Return exec systemd-run-i3 -n alacritty --class floating --working-directory "$(xcwd)"
|
||||
bindsym $mod+v exec systemd-run-i3 -n alacritty -e sh -c "($SHELL -c $EDITOR || :) && $SHELL"
|
||||
bindsym $mod+Ctrl+v exec systemd-run-i3 -n alacritty --class floating -e sh -c "($SHELL -c $EDITOR || : ) && $SHELL"
|
||||
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 -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+e exec "pkill rofi; rofi -show emoji -modi emoji -normal-window"
|
||||
bindsym $mod+Shift+i exec rofi-fontawesome
|
||||
bindsym --release Print exec screenshot
|
||||
bindsym --release $mod+Print exec imgur-screenshot
|
||||
bindsym $mod+Shift+x exec systemd-run-i3 -n i3-sensible-terminal --class floating-term --hold -e /bin/echo "$(xprop -id $(xdotool getactivewindow))"
|
||||
bindsym $mod+$alt+space exec systemd-run-i3 -n ~/.config/i3/cycleaudio.py && pkill -RTMIN+10 i3blocks
|
||||
bindsym $mod+numbersign exec systemd-run-i3 -n i3-sensible-terminal --hold -e sh -c 'xclip -o | gpg --decrypt 2>&1'
|
||||
bindsym $mod+r exec bash -c 'pwgen -snc 32 1 | tee >(xargs notify-send Generated\ password\:) | xclip -i -r'
|
||||
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
|
||||
bindsym XF86AudioPlay exec --no-startup-id playerctl -a play-pause
|
||||
bindsym XF86AudioPause exec --no-startup-id playerctl -a pause
|
||||
bindsym XF86AudioStop exec --no-startup-id playerctl -a stop
|
||||
bindsym XF86AudioNext exec --no-startup-id playerctl -a next
|
||||
bindsym XF86AudioPrev exec --no-startup-id playerctl -a previous
|
||||
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +1000
|
||||
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -1000
|
||||
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle
|
||||
bindsym XF86MonBrightnessUp exec light -A 5 && pkill -RTMIN+12 i3blocks
|
||||
bindsym XF86MonBrightnessDown exec light -U 5 && pkill -RTMIN+12 i3blocks
|
||||
|
||||
# vim:ft=i3
|
31
i3/cycleaudio.py
Executable file
31
i3/cycleaudio.py
Executable file
@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import subprocess as sp
|
||||
import re
|
||||
|
||||
# This script cycles pulseaudio sinks and changes the defaults.
|
||||
# Audio playback is also moved to the new default sink. The script
|
||||
# is intended to bind to some keyboard shortcut to cycle through
|
||||
# outputs on the fly.
|
||||
#
|
||||
# Requirements: pacmd, python3
|
||||
|
||||
dev_out, _ = sp.Popen('pacmd list-sinks', shell=True, stdout=sp.PIPE).communicate()
|
||||
inp_out, _ = sp.Popen('pacmd list-sink-inputs', shell=True, stdout=sp.PIPE).communicate()
|
||||
|
||||
devices = re.findall(r"(\*?) index: (\d+)", str(dev_out))
|
||||
inputs = re.findall(r"index: (\d+)", str(inp_out))
|
||||
|
||||
# find the next default device, i.e., the one after the current default
|
||||
found = False
|
||||
next_device = devices[0][1]
|
||||
for d in devices:
|
||||
if found:
|
||||
next_device = d[1]
|
||||
break
|
||||
found = (d[0] == "*")
|
||||
|
||||
# set default device and move inputs
|
||||
sp.call(["pacmd", "set-default-sink", next_device])
|
||||
for i in inputs:
|
||||
sp.call(["pacmd", "move-sink-input", i, next_device])
|
33
i3/disable-standby-fs.py
Executable file
33
i3/disable-standby-fs.py
Executable file
@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from argparse import ArgumentParser
|
||||
from subprocess import call
|
||||
import i3ipc
|
||||
|
||||
i3 = i3ipc.Connection()
|
||||
|
||||
parser = ArgumentParser(prog='disable-standby-fs',
|
||||
description='''
|
||||
Disable standby (dpms) and screensaver when a window becomes fullscreen
|
||||
or exits fullscreen-mode. Requires `xorg-xset`.
|
||||
''')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
def on_fullscreen_mode(i3, e):
|
||||
if e.container.props.fullscreen_mode:
|
||||
call(['xautolock', '-disable'])
|
||||
print("disabling autolock")
|
||||
else:
|
||||
call(['xautolock', '-enable'])
|
||||
print("enabling autolock")
|
||||
|
||||
def on_window_close(i3, e):
|
||||
if e.container.props.fullscreen_mode:
|
||||
call(['xautolock', '-enable'])
|
||||
print("enabling autolock")
|
||||
|
||||
i3.on('window::fullscreen_mode', on_fullscreen_mode)
|
||||
i3.on('window::close', on_window_close)
|
||||
|
||||
i3.main()
|
17
i3/powermenu.sh
Executable file
17
i3/powermenu.sh
Executable file
@ -0,0 +1,17 @@
|
||||
#!/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 | cut -d' ' -f2- | xargs)"
|
||||
|
||||
case $option in
|
||||
lock) dm-tool switch-to-greeter;;
|
||||
logout) systemctl --user exit;;
|
||||
sleep) systemctl suspend;;
|
||||
hibernate) systemctl hibernate;;
|
||||
power\ off) systemctl poweroff;;
|
||||
reboot) systemctl reboot;;
|
||||
windows)
|
||||
windows=`efibootmgr | grep -Po -m1 'Boot\K(\d{4}).*Windows.*' | head -c4`
|
||||
sudo efibootmgr -n $windows
|
||||
reboot;;
|
||||
esac
|
Reference in New Issue
Block a user