mirror of
				https://github.com/rad4day/Waybar.git
				synced 2025-10-30 23:42:42 +01:00 
			
		
		
		
	Merge branch 'Alexays:master' into sort-workspaces-by-number
This commit is contained in:
		
							
								
								
									
										35
									
								
								include/modules/sway/scratchpad.hpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								include/modules/sway/scratchpad.hpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,35 @@ | ||||
| #pragma once | ||||
|  | ||||
| #include <gtkmm/label.h> | ||||
|  | ||||
| #include <mutex> | ||||
| #include <string> | ||||
|  | ||||
| #include "ALabel.hpp" | ||||
| #include "bar.hpp" | ||||
| #include "client.hpp" | ||||
| #include "modules/sway/ipc/client.hpp" | ||||
| #include "util/json.hpp" | ||||
|  | ||||
| namespace waybar::modules::sway { | ||||
| class Scratchpad : public ALabel { | ||||
|  public: | ||||
|   Scratchpad(const std::string&, const Json::Value&); | ||||
|   ~Scratchpad() = default; | ||||
|   auto update() -> void; | ||||
|  | ||||
|  private: | ||||
|   auto getTree() -> void; | ||||
|   auto onCmd(const struct Ipc::ipc_response&) -> void; | ||||
|   auto onEvent(const struct Ipc::ipc_response&) -> void; | ||||
|  | ||||
|   std::string tooltip_format_; | ||||
|   bool show_empty_; | ||||
|   bool tooltip_enabled_; | ||||
|   std::string tooltip_text_; | ||||
|   int count_; | ||||
|   std::mutex mutex_; | ||||
|   Ipc ipc_; | ||||
|   util::JsonParser parser_; | ||||
| }; | ||||
| }  // namespace waybar::modules::sway | ||||
							
								
								
									
										34
									
								
								include/modules/user.hpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								include/modules/user.hpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,34 @@ | ||||
| #pragma once | ||||
|  | ||||
| #include <fmt/chrono.h> | ||||
| #include <gdkmm/pixbuf.h> | ||||
| #include <glibmm/refptr.h> | ||||
|  | ||||
| #include "AIconLabel.hpp" | ||||
| #include "util/sleeper_thread.hpp" | ||||
|  | ||||
| namespace waybar::modules { | ||||
| class User : public AIconLabel { | ||||
|  public: | ||||
|   User(const std::string&, const Json::Value&); | ||||
|   ~User() = default; | ||||
|   auto update() -> void; | ||||
|  | ||||
|  private: | ||||
|   util::SleeperThread thread_; | ||||
|  | ||||
|   Glib::RefPtr<Gdk::Pixbuf> pixbuf_; | ||||
|  | ||||
|   static constexpr inline int defaultUserImageWidth_ = 20; | ||||
|   static constexpr inline int defaultUserImageHeight_ = 20; | ||||
|  | ||||
|   long uptime_as_seconds(); | ||||
|   std::string get_user_login(); | ||||
|   std::string get_user_home_dir(); | ||||
|   std::string get_default_user_avatar_path(); | ||||
|   void init_default_user_avatar(int width, int height); | ||||
|   void init_user_avatar(const std::string& path, int width, int height); | ||||
|   void init_avatar(const Json::Value& config); | ||||
|   void init_update_worker(); | ||||
| }; | ||||
| }  // namespace waybar::modules | ||||
		Reference in New Issue
	
	Block a user
	 herlev
					herlev