diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index cfa83ea..4e50c55 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -381,9 +381,9 @@ globalkeys = gears.table.join( {description = "open nemo", group = "launcher"}), -- set to spawn after key release to work - awful.key({ modkey, }, "q", nil, function () awful.spawn.with_shell("~/.config/awesome/screenshot.sh") end, + awful.key({ modkey, }, "q", nil, function () awful.spawn.with_shell("~/.config/wm_scripts/screenshot.sh") end, {description = "dmenu screenshot prompt", group = "launcher"}), - awful.key({ modkey, }, "1", function() awful.spawn.with_shell("~/.config/awesome/layout.sh") end, + awful.key({ modkey, }, "1", function() awful.spawn.with_shell("~/.config/wm_scripts/layout.sh") end, { description = "change keyboard layout", group = "launcher"}) -- layout -- awful.key({ modkey, altkey, }, "Tab", function() awful.spawn.with_shell("~/.config/awesome/layout.sh") end, @@ -683,6 +683,6 @@ for _,rule in pairs(custom_rules) do end -- Autostart: -awful.spawn.with_shell("~/.config/awesome/autorun.sh") +awful.spawn.with_shell("~/.config/awesome/autostart.sh") diff --git a/.config/wm_scripts/autostart.sh b/.config/wm_scripts/autostart.sh new file mode 100755 index 0000000..f45a2a3 --- /dev/null +++ b/.config/wm_scripts/autostart.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +function run() +{ + if ! pgrep -f $1; then + $1& + fi +} + +run firefox +run discord +run "alacritty --working-directory $HOME/" diff --git a/.config/wm_scripts/layout.sh b/.config/wm_scripts/layout.sh new file mode 100755 index 0000000..b495f4d --- /dev/null +++ b/.config/wm_scripts/layout.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# dmenu script to change Xorg layout +options=" +1) US\n\ +2) Colemak +" + +# dmenu +#option=$(echo -e $options | dmenu -i) +# rofi emulation of dmenu +option=$(echo "1) US|2) Colemak" | rofi -dmenu -sep '|' -i) + +echo $option + +case $option in +1*) + setxkbmap us + ;; +2*) + setxkbmap us -variant colemak + ;; +esac diff --git a/.config/wm_scripts/screenshot.sh b/.config/wm_scripts/screenshot.sh new file mode 100755 index 0000000..562b2af --- /dev/null +++ b/.config/wm_scripts/screenshot.sh @@ -0,0 +1,30 @@ +#!/bin/bash +#dmenu script for screenshots +CUSTOM_SCRIPTS_FILE=~/.custom_bash_scripts +if test -f $CUSTOM_SCRIPTS_FILE; then + source $CUSTOM_SCRIPTS_FILE +else + echo ".custom_bash_scripts.sh does not exist." +fi + +options=" +1) Fullscreen\n\ +2) Selection +" +#echo -e $options + +# -i case insensitive +# -l vertical lines +option=$(echo -e $options | dmenu -i) + +#echo "\"$option\"" +case $option in +1*) + sleep 0.5 + f_scrot + ;; +2*) + s_scrot + ;; +esac +