Repository: arnaudmiribel/streamlit-extras

Issue:
Add code to change running widget position
See [thread](https://discuss.streamlit.io/t/change-the-running-widget-position/30466)

Discussion:

Patch:
diff --git a/gallery/streamlit_app.py b/gallery/streamlit_app.py
index 2fa56c6..5d42bba 100644
--- a/gallery/streamlit_app.py
+++ b/gallery/streamlit_app.py
@@ -11,6 +11,7 @@ import streamlit_patches as st
 import streamlit_extras
 from streamlit_extras.badges import badge
 from streamlit_extras.function_explorer import function_explorer
+from streamlit_extras.mention import mention
 from streamlit_extras.switch_page_button import switch_page
 
 
@@ -126,6 +127,7 @@ def get_page_content(
     author: str,
     github_repo: Optional[str] = None,
     streamlit_cloud_url: Optional[str] = None,
+    forum_url: Optional[str] = None,
     pypi_name: Optional[str] = None,
     package_name: Optional[str] = None,
     twitter_username: Optional[str] = None,
@@ -148,6 +150,7 @@ def get_page_content(
                 pypi_name,
                 twitter_username,
                 buymeacoffee_username,
+                forum_url,
             ]
         ):
             columns = cycle(st.columns(6))
@@ -166,6 +169,9 @@ def get_page_content(
             if buymeacoffee_username:
                 with next(columns):
                     badge("buymeacoffee", name=buymeacoffee_username)
+            if forum_url:
+                with next(columns):
+                    mention(icon="streamlit", url=forum_url, label="Forum post")
 
         st.write("## Usage")
 
@@ -227,6 +233,7 @@ for extra_name in extra_names:
     package_name = getattr(mod, "__package_name__", None)
     twitter_username = getattr(mod, "__twitter_username__", None)
     buymeacoffee_username = getattr(mod, "__buymeacoffee_username__", None)
+    forum_url = getattr(mod, "__forum_url__", None)
     experimental_playground = getattr(mod, "__experimental_playground__", False)
 
     settings[extra_name] = dict(
@@ -245,6 +252,7 @@ for extra_name in extra_names:
             package_name=package_name,
             twitter_username=twitter_username,
             buymeacoffee_username=buymeacoffee_username,
+            forum_url=forum_url,
             experimental_playground=experimental_playground,
         ),
         name=title,
diff --git a/src/streamlit_extras/customize_running/__init__.py b/src/streamlit_extras/customize_running/__init__.py
new file mode 100644
index 0000000..ac0e8ad
--- /dev/null
+++ b/src/streamlit_extras/customize_running/__init__.py
@@ -0,0 +1,41 @@
+import time
+
+import streamlit as st
+
+center_css = """
+<style>
+
+div[class*="StatusWidget"]{
+
+    position: fixed;
+    top: 50%;
+    left: 50%;
+    transform: translate(-50%, -50%);
+    width: 50%;
+}
+
+</style>
+"""
+
+
+def center_running():
+    st.markdown(center_css, unsafe_allow_html=True)
+
+
+def example():
+    click = st.button("Observe where the 🏃‍♂️ running widget is now!")
+    if click:
+        center_running()
+        time.sleep(2)
+
+
+__func__ = center_running
+__title__ = "Customize running"
+__desc__ = "Customize the running widget"
+__icon__ = "🏃‍♂️"
+__examples__ = [example]
+__author__ = "koninhoo"
+__forum_url__ = (
+    "https://discuss.streamlit.io/t/change-the-running-widget-position/30466"
+)
+__experimental_playground__ = False


Test patch:
diff --git a/tests/test_extras.py b/tests/test_extras.py
index ae09043..ec81111 100644
--- a/tests/test_extras.py
+++ b/tests/test_extras.py
@@ -30,9 +30,13 @@ def test_extra_attributes(extra: str):
         assert type(mod.__package_name__) == str
     if hasattr(mod, "__streamlit_cloud_url__"):
         assert type(mod.__streamlit_cloud_url__) == str
+        assert "streamlit" in mod.__streamlit_cloud_url__
     if hasattr(mod, "__twitter_username__"):
         assert type(mod.__twitter_username__) == str
     if hasattr(mod, "__buymeacoffee_username__"):
         assert type(mod.__buymeacoffee_username__) == str
+    if hasattr(mod, "__forum_url__"):
+        assert type(mod.__forum_url__) == str
+        assert "discuss.streamlit.io" in mod.__forum_url__
     if hasattr(mod, "__experimental_playground__"):
         assert type(mod.__experimental_playground__) == bool