sway stuff
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
function move {
|
function move {
|
||||||
CURR_WORKSPACE=$(swaymsg -t get_workspaces | jq -r '. | map(select(.focused == true)) | .[0].name')
|
CURR_WORKSPACE=$(swaymsg -t get_workspaces | jq -r '. | map(select(.focused == true)) | .[0].name')
|
||||||
|
|
||||||
@@ -8,6 +10,7 @@ function move {
|
|||||||
NEW_WORKSPACE=$(expr ${CURR_WORKSPACE} + 1)
|
NEW_WORKSPACE=$(expr ${CURR_WORKSPACE} + 1)
|
||||||
;;
|
;;
|
||||||
"prev")
|
"prev")
|
||||||
|
[ ${CURR_WORKSPACE} -eq 1 ] && exit 0
|
||||||
NEW_WORKSPACE=$(expr ${CURR_WORKSPACE} - 1)
|
NEW_WORKSPACE=$(expr ${CURR_WORKSPACE} - 1)
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -16,8 +19,30 @@ function move {
|
|||||||
swaymsg "workspace ${NEW_WORKSPACE}"
|
swaymsg "workspace ${NEW_WORKSPACE}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function focus {
|
||||||
|
CURR_WORKSPACE=$(swaymsg -t get_workspaces | jq -r '. | map(select(.focused == true)) | .[0].name')
|
||||||
|
|
||||||
|
echo $CURR_WORKSPACE
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
"next")
|
||||||
|
NEW_WORKSPACE=$(expr ${CURR_WORKSPACE} + 1)
|
||||||
|
;;
|
||||||
|
"prev")
|
||||||
|
[ ${CURR_WORKSPACE} -eq 1 ] && exit 0
|
||||||
|
NEW_WORKSPACE=$(expr ${CURR_WORKSPACE} - 1)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
swaymsg "workspace ${NEW_WORKSPACE}"
|
||||||
|
}
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
"move")
|
"move")
|
||||||
move $2
|
move $2
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"focus")
|
||||||
|
focus $2
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -31,6 +31,51 @@ in {
|
|||||||
wayland.windowManager.sway = {
|
wayland.windowManager.sway = {
|
||||||
enable = true;
|
enable = true;
|
||||||
config = {
|
config = {
|
||||||
|
bars = [
|
||||||
|
{
|
||||||
|
mode = "dock";
|
||||||
|
hiddenState = "hide";
|
||||||
|
position = "bottom";
|
||||||
|
workspaceButtons = true;
|
||||||
|
workspaceNumbers = true;
|
||||||
|
statusCommand = "${pkgs.i3status}/bin/i3status";
|
||||||
|
fonts = {
|
||||||
|
names = ["monospace"];
|
||||||
|
size = 12.0;
|
||||||
|
};
|
||||||
|
trayOutput = "primary";
|
||||||
|
colors = {
|
||||||
|
background = "#000000";
|
||||||
|
statusline = "#ffffff";
|
||||||
|
separator = "#666666";
|
||||||
|
focusedWorkspace = {
|
||||||
|
border = "#4c7899";
|
||||||
|
background = "#285577";
|
||||||
|
text = "#ffffff";
|
||||||
|
};
|
||||||
|
activeWorkspace = {
|
||||||
|
border = "#333333";
|
||||||
|
background = "#5f676a";
|
||||||
|
text = "#ffffff";
|
||||||
|
};
|
||||||
|
inactiveWorkspace = {
|
||||||
|
border = "#333333";
|
||||||
|
background = "#222222";
|
||||||
|
text = "#888888";
|
||||||
|
};
|
||||||
|
urgentWorkspace = {
|
||||||
|
border = "#2f343a";
|
||||||
|
background = "#900000";
|
||||||
|
text = "#ffffff";
|
||||||
|
};
|
||||||
|
bindingMode = {
|
||||||
|
border = "#2f343a";
|
||||||
|
background = "#900000";
|
||||||
|
text = "#ffffff";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
input = {
|
input = {
|
||||||
"*" = {
|
"*" = {
|
||||||
xkb_layout = "gb";
|
xkb_layout = "gb";
|
||||||
@@ -57,11 +102,11 @@ in {
|
|||||||
"${mod}+Down" = "movewindow down";
|
"${mod}+Down" = "movewindow down";
|
||||||
"${mod}+Right" = "movewindow right";
|
"${mod}+Right" = "movewindow right";
|
||||||
|
|
||||||
"${mod}+Shift+h" = "swayutils move prev";
|
"${mod}+Shift+h" = "exec ${config.home.homeDirectory}/bin/swayutils move prev";
|
||||||
"${mod}+Shift+l" = "swayutils move next";
|
"${mod}+Shift+l" = "exec ${config.home.homeDirectory}/bin/swayutils move next";
|
||||||
|
|
||||||
"${mod}+Control+h" = "workspace prev";
|
"${mod}+Control+h" = "exec ${config.home.homeDirectory}/bin/swayutils focus prev";
|
||||||
"${mod}+Control+l" = "workspace next";
|
"${mod}+Control+l" = "exec ${config.home.homeDirectory}/bin/swayutils focus next";
|
||||||
|
|
||||||
"${hyper}+y" = "move left";
|
"${hyper}+y" = "move left";
|
||||||
"${hyper}+o" = "move right";
|
"${hyper}+o" = "move right";
|
||||||
|
|||||||
Reference in New Issue
Block a user