Compare commits
5 Commits
6e7e845a6c
...
29e941e3d5
Author | SHA1 | Date | |
---|---|---|---|
|
29e941e3d5 | ||
9109f7660c | |||
e1043e982d | |||
ac1464d965 | |||
40104086fe |
67
i38.sh
67
i38.sh
@ -5,6 +5,7 @@
|
||||
# Released under the terms of the WTFPL http://www.wtfpl.net
|
||||
|
||||
i3Path="${XDG_CONFIG_HOME:-$HOME/.config}/i3"
|
||||
i3msg="i3-msg"
|
||||
# Dialog accessibility
|
||||
export DIALOGOPTS='--no-lines --visit-items'
|
||||
|
||||
@ -131,6 +132,7 @@ update_scripts() {
|
||||
# Array of command line arguments
|
||||
declare -A command=(
|
||||
[h]="This help screen."
|
||||
[s]="Create sway configuration instead of i3."
|
||||
[u]="Copy over the latest version of scripts."
|
||||
[x]="Generate ~/.xinitrc and ~/.xprofile."
|
||||
[X]="Generate ~/.xprofile only."
|
||||
@ -142,6 +144,10 @@ args="${args//[[:space:]]/}"
|
||||
while getopts "${args}" i ; do
|
||||
case "$i" in
|
||||
h) help;;
|
||||
s)
|
||||
i3msg="swaymsg"
|
||||
i3Path="${XDG_CONFIG_HOME:-$HOME/.config}/sway"
|
||||
;;
|
||||
u) update_scripts;;
|
||||
x) write_xinitrc ;&
|
||||
X) write_xprofile ;;
|
||||
@ -253,17 +259,15 @@ cat << EOF > ${i3Path}/config
|
||||
#
|
||||
# This config file uses keycodes (bindsym) and was written for the QWERTY
|
||||
# layout.
|
||||
#
|
||||
# To get a config file with the same key positions, but for your current
|
||||
# layout, use the i3-config-wizard
|
||||
#
|
||||
#set mod key
|
||||
|
||||
# set mod key
|
||||
set \$mod $mod
|
||||
|
||||
#set workspace layout to tapped so apps use most of the screen
|
||||
# set workspace layout to tabbed so apps use most of the screen
|
||||
workspace_layout tabbed
|
||||
|
||||
#set the mouse so it is trapped in focused window
|
||||
# set the mouse so it is trapped in focused window
|
||||
# this fixes some issues in some games that require focus and pause when focus is moved via mouse accidentally
|
||||
focus_follows_mouse no
|
||||
|
||||
# Font for window titles. Will also be used by the bar unless a different font
|
||||
@ -280,8 +284,8 @@ bindsym \$mod+Control+c exec clipster -s
|
||||
bindsym \$mod+Control+Delete exec --no-startup-id sgtk-bar
|
||||
|
||||
# Use pactl to adjust volume in PulseAudio.
|
||||
bindsym \$mod+XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +${volumeJump}% & play -qnG synth 0.05 sin 440
|
||||
bindsym \$mod+XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -${volumeJump}% & play -qnG synth 0.05 sin 440
|
||||
bindsym \$mod+XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +${volumeJump}% & play -qnG synth 0.03 sin 440
|
||||
bindsym \$mod+XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -${volumeJump}% & play -qnG synth 0.03 sin 440
|
||||
bindsym \$mod+XF86AudioMute exec --no-startup-id ${i3Path}/scripts/mute-unmute.sh
|
||||
|
||||
# Music player controls
|
||||
@ -308,18 +312,13 @@ bindsym \$mod+F1 exec --no-startup-id sgtk-menu -f
|
||||
bindsym \$mod+Control+d exec --no-startup-id yad --icons --compact --no-buttons --title="Desktop" --close-on-unfocus --read-dir=${HOME}/Desktop
|
||||
|
||||
# change focus
|
||||
# alt+tab and shift tab
|
||||
# alt+tab and alt+shift+tab
|
||||
bindsym Mod1+Shift+Tab focus left
|
||||
bindsym Mod1+Tab focus right
|
||||
|
||||
# enter fullscreen mode for the focused container
|
||||
bindsym \$mod+BackSpace fullscreen toggle
|
||||
|
||||
# focus the parent container
|
||||
#bindsym \$mod+a focus parent
|
||||
|
||||
# focus the child container
|
||||
#bindsym \$mod+d focus child
|
||||
|
||||
# move the currently focused window to the scratchpad
|
||||
bindsym \$mod+Shift+minus move scratchpad
|
||||
@ -379,7 +378,6 @@ bindsym e exec $textEditor, mode "default"
|
||||
bindsym f exec $fileBrowser, mode "default"
|
||||
# Web browser bound to w
|
||||
bindsym w exec $webBrowser, mode "default"
|
||||
bindsym g exec ${i3Path}/scripts/game_controler.sh -s, mode "default"
|
||||
$(if command -v mumble &> /dev/null ; then
|
||||
echo "bindsym m exec $(command -v mumble), mode \"default\""
|
||||
fi)
|
||||
@ -392,8 +390,10 @@ fi)
|
||||
$(if command -v transfersh &> /dev/null ; then
|
||||
echo 'bindsym t exec bash -c '"'"'fileName="$(yad --title "I38 Upload File" --file)" && url="$(transfersh "${fileName}" | tee >(yad --title "I38 - Uploading ${fileName##*/} ..." --progress --pulsate --auto-close))" && echo "${url#*saved at: }" | tee >(yad --title "I38 - Upload URL" --show-cursor --show-uri --button yad-close --sticky --text-info) >(xclip -selection clipboard)'"', mode \"default\""
|
||||
fi)
|
||||
bindsym Mod1+Shift+0 exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +${volumeJump}%
|
||||
bindsym Mod1+Shift+9 exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -${voluemJump}%
|
||||
|
||||
#Keyboard based volume Controls with pulseaudio
|
||||
bindsym Mod1+Shift+0 exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +${volumeJump}% & play -qnG synth 0.03 sin 440
|
||||
bindsym Mod1+Shift+9 exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -${volumeJump}% & play -qnG synth 0.03 sin 440
|
||||
# Music player controls
|
||||
# Requires playerctl.
|
||||
bindsym Mod1+Shift+equal exec --no-startup-id ${i3Path}/scripts/music_controler.sh incvol $volumeJump, mode "default"
|
||||
@ -401,21 +401,23 @@ bindsym Mod1+Shift+minus exec --no-startup-id ${i3Path}/scripts/music_controler.
|
||||
bindsym Mod1+Shift+z exec --no-startup-id ${i3Path}/scripts/music_controler.sh prev, mode "default"
|
||||
bindsym Mod1+Shift+c exec --no-startup-id ${i3Path}/scripts/music_controler.sh pause, mode "default"
|
||||
bindsym Mod1+Shift+x exec --no-startup-id ${i3Path}/scripts/music_controler.sh play, mode "default"
|
||||
bindsym Mod1+Shitf+v exec --no-startup-id ${i3Path}/scripts/music_controler.sh stop, mode "default"
|
||||
bindsym Mod1+Shift+v exec --no-startup-id ${i3Path}/scripts/music_controler.sh stop, mode "default"
|
||||
bindsym Mod1+Shift+b exec --no-startup-id ${i3Path}/scripts/music_controler.sh next, mode "default"
|
||||
bindsym Mod1+Shift+u exec --no-startup-id ${i3Path}/scripts/music_controler.sh info, mode "default"
|
||||
#Check battery status
|
||||
bindsym Mod1+b exec --no-startup-id ${i3Path}/scripts/battery_status.sh, mode "default"
|
||||
#Check controller battery status
|
||||
bindsym g exec ${i3Path}/scripts/game_controler.sh -s, mode "default"
|
||||
# Get a list of windows in the current workspace
|
||||
bindsym apostrophe exec --no-startup-id ${i3Path}/scripts/window_list.sh, mode "default"
|
||||
# Restart orca
|
||||
bindsym Shift+o exec $(command -v orca) --replace, mode "default"
|
||||
# reload the configuration file
|
||||
bindsym Control+semicolon exec bash -c 'i3-msg -t run_command reload && spd-say -P important -Cw "I38 Configuration reloaded."', mode "default"
|
||||
bindsym Control+semicolon exec bash -c '$i3msg -t run_command reload && spd-say -P important -Cw "I38 Configuration reloaded."', mode "default"
|
||||
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
|
||||
bindsym Control+Shift+semicolon exec bash -c 'i3-msg -t run_command restart && spd-say -P important -Cw "I3 restarted."', mode "default"
|
||||
bindsym Control+Shift+semicolon exec bash -c '$i3msg -t run_command restart && spd-say -P important -Cw "I3 restarted."', mode "default"
|
||||
# exit i3 (logs you out of your X session)
|
||||
bindsym Control+q exec bash -c 'yad --image "dialog-question" --title "I38" --button=yes:0 --button=no:1 --text "You pressed the exit shortcut. Do you really want to exit i3? This will end your X session." && i3-msg -t run_command exit'
|
||||
bindsym Control+q exec bash -c 'yad --image "dialog-question" --title "I38" --button=yes:0 --button=no:1 --text "You pressed the exit shortcut. Do you really want to exit i3? This will end your X session." && $i3msg -t run_command exit'
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
|
||||
@ -432,7 +434,7 @@ bindsym \$mod+e exec $textEditor
|
||||
bindsym \$mod+f exec $fileBrowser
|
||||
# Web browser bound to $mod+w
|
||||
bindsym \$mod+w exec $webBrowser
|
||||
bindsym \$mod+g exec ${i3Path}/scripts/game_controler.sh -s, mode "default"
|
||||
|
||||
$(if command -v mumble &> /dev/null ; then
|
||||
echo "bindsym \$mod+m exec $(command -v mumble)"
|
||||
fi)
|
||||
@ -443,10 +445,11 @@ $(if command -v pidgin &> /dev/null ; then
|
||||
echo "bindsym \$mod+p exec $(command -v pidgin)"
|
||||
fi)
|
||||
$(if command -v transfersh &> /dev/null ; then
|
||||
echo 'bindsym \$mod+t exec bash -c '"'"'fileName="$(yad --title "I38 Upload File" --file)" && url="$(transfersh "${fileName}" | tee >(yad --title "I38 - Uploading ${fileName##*/} ..." --progress --pulsate --auto-close))" && echo "${url#*saved at: }" | tee >(yad --title "I38 - Upload URL" --show-cursor --show-uri --button yad-close --sticky --text-info) >(xclip -selection clipboard)'"', mode \"default\""
|
||||
echo 'bindsym \$mod+t exec bash -c '"'"'fileName="$(yad --title "I38 Upload File" --file)" && url="$(transfersh "${fileName}" | tee >(yad --title "I38 - Uploading ${fileName##*/} ..." --progress --pulsate --auto-close))" && echo "${url#*saved at: }" | tee >(yad --title "I38 - Upload URL" --show-cursor --show-uri --button yad-close --sticky --text-info) >(xclip -selection clipboard)'"'"
|
||||
fi)
|
||||
bindsym \$mod+Shift+0 exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +${volumeJump}%
|
||||
bindsym \$mod+Shift+9 exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -${voluemJump}%
|
||||
#Keyboard based volume controls using pulseaudio
|
||||
bindsym \$mod+Shift+0 exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +${volumeJump}% & play -qnG synth 0.03 sin 440
|
||||
bindsym \$mod+Shift+9 exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -${volumeJump}% & play -qnG synth 0.03 sin 440
|
||||
# Music player controls
|
||||
# Requires playerctl.
|
||||
bindsym \$mod+Shift+equal exec --no-startup-id ${i3Path}/scripts/music_controler.sh incvol $volumeJump
|
||||
@ -454,22 +457,24 @@ bindsym \$mod+Shift+minus exec --no-startup-id ${i3Path}/scripts/music_controler
|
||||
bindsym \$mod+Shift+z exec --no-startup-id ${i3Path}/scripts/music_controler.sh prev
|
||||
bindsym \$mod+Shift+c exec --no-startup-id ${i3Path}/scripts/music_controler.sh pause
|
||||
bindsym \$mod+Shift+x exec --no-startup-id ${i3Path}/scripts/music_controler.sh play
|
||||
bindsym \$mod+Shitf+v exec --no-startup-id ${i3Path}/scripts/music_controler.sh stop
|
||||
bindsym \$mod+Shift+v exec --no-startup-id ${i3Path}/scripts/music_controler.sh stop
|
||||
bindsym \$mod+Shift+b exec --no-startup-id ${i3Path}/scripts/music_controler.sh next
|
||||
bindsym \$mod+Shift+u exec --no-startup-id ${i3Path}/scripts/music_controler.sh info
|
||||
#Check battery status
|
||||
bindsym \$mod+b exec --no-startup-id ${i3Path}/scripts/battery_status.sh
|
||||
#Check controller battery status
|
||||
bindsym \$mod+g exec ${i3Path}/scripts/game_controler.sh -s
|
||||
# Get a list of windows in the current workspace
|
||||
bindsym \$mod+apostrophe exec --no-startup-id ${i3Path}/scripts/window_list.sh
|
||||
# Restart orca
|
||||
bindsym \$mod+Shift+o exec $(command -v orca) --replace
|
||||
# reload the configuration file
|
||||
bindsym \$mod+Control+semicolon exec bash -c 'i3-msg -t run_command reload && spd-say -P important -Cw "I38 Configuration reloaded."'
|
||||
bindsym \$mod+Control+semicolon exec bash -c '$i3msg -t run_command reload && spd-say -P important -Cw "I38 Configuration reloaded."'
|
||||
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
|
||||
bindsym \$mod+Control+Shift+semicolon exec bash -c 'i3-msg -t run_command restart && spd-say -P important -Cw "I3 restarted."'
|
||||
bindsym \$mod+Control+Shift+semicolon exec bash -c '$i3msg -t run_command restart && spd-say -P important -Cw "I3 restarted."'
|
||||
# exit i3 (logs you out of your X session)
|
||||
bindsym \$mod+Control+q exec bash -c 'yad --image "dialog-question" --title "I38" --button=yes:0 --button=no:1 --text "You pressed the exit shortcut. Do you really want to exit i3? This will end your X session." && i3-msg -t run_command exit'
|
||||
}
|
||||
bindsym \$mod+Control+q exec bash -c 'yad --image "dialog-question" --title "I38" --button=yes:0 --button=no:1 --text "You pressed the exit shortcut. Do you really want to exit i3? This will end your X session." && $i3msg -t run_command exit'
|
||||
|
||||
|
||||
|
||||
EOF
|
||||
|
Loading…
Reference in New Issue
Block a user