Skip to content
Snippets Groups Projects
Commit d3d0e20d authored by Jens Nolte's avatar Jens Nolte
Browse files

Group different 'server' options in cli (breaking change)

parent c83d79ee
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@
set -e
set -u
set -o pipefail
readonly executable_name=qbar
readonly sway_bar_id=bar-0
......@@ -16,7 +17,7 @@ mkfifo $stderr
trap "swaymsg bar $sway_bar_id status_command '$default_bar_command'; rm -rf $temp_dir" EXIT INT HUP TERM
swaymsg bar $sway_bar_id status_command "exec $(stack path --local-install-root)/bin/$executable_name $@ -- server 2> $stderr"
swaymsg bar $sway_bar_id status_command "exec $(stack path --local-install-root)/bin/$executable_name $@ -- server swaybar 2> $stderr"
# show output and run forever (use Ctrl-C to stop)
cat $stderr
......@@ -38,12 +38,16 @@ mainParser = do
barCommandParser :: Parser (MainOptions -> IO ())
barCommandParser = hsubparser (
command "server" (info (runBarServer <$> barConfigurationParser) (progDesc "Start a new qbar server. Should be called by swaybar, i3bar or or another i3bar-protocol compatible host process.")) <>
command "connect" (info (sendBlockStream <$> barConfigurationParser) (progDesc "Run blocks on this process but display them on the qbar server.")) <>
command "server" (info serverCommandParser (progDesc "Start a new server.")) <>
command "pipe" (info pipeClientParser (progDesc "Redirects the stdin of this process to a running bar.")) <>
command "theme" (info themeCommandParser (progDesc "Change the theme of the running qbar server.")) <>
command "default" (info (pure $ sendIpc . SetTheme $ "default") (progDesc "Shortcut for 'qbar theme default'.")) <>
command "rainbow" (info (pure $ sendIpc . SetTheme $ "rainbow") (progDesc "Shortcut for 'qbar theme rainbow'."))
command "theme" (info themeCommandParser (progDesc "Change the theme of the running qbar server."))
)
serverCommandParser :: Parser (MainOptions -> IO ())
serverCommandParser = hsubparser (
command "swaybar" (info (runBarServer <$> barConfigurationParser) (progDesc "Start a new server for swaybar. Should be called by swaybar.")) <>
command "i3bar" (info (runBarServer <$> barConfigurationParser) (progDesc "Start a new server for i3bar. Should be called by i3bar.")) <>
command "connect" (info (sendBlockStream <$> barConfigurationParser) (progDesc "Run blocks on this process but send them to another qbar server."))
)
themeCommandParser :: Parser (MainOptions -> IO ())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment